GrainSizeTools Icon



A Python script to estimate the grain size from thin sections

Add a Review
2 Downloads (This Week)
Last Update:
Browse All Files
Windows Mac Linux



GrainSizeTools is a free and open source cross-platform script written in Python that provides a robust method to obtain a single numeric value representative of dynamically recrystallized grain size in deformed rocks. There is no need of prior knowledge of Python language to use the script and get the results. The script only requires the previous measurement of the grain sectional areas from a thin section. The aim of the script is to use this value in paleopiezometry and paleowattometry studies. A full paper describing the method applied by the script can be found here: It is planned to extend the capabilities of the script in the future.

see a brief tutorial here:
about the author:

GrainSizeTools Web Site


  • The script is free and open-source
  • It allows to load text files -txt or csv- with the sectional areas of the grains
  • It allows to calculate the apparent diameters of the grains from the sectional areas via the equivalent circular diameter
  • It allows to correct the diameters calculated by adding the perimeter of the grains
  • It returns a representative single value of grain size based on the Gaussian kernel density estimation peak
  • It returns the modal intervals of the number- and area-weighted approaches and the area-weighted mean of the apparent grain size population
  • It produces ready-to-publish number- and area-weighted grain size plots, allowing to save the graphical output as a bitmap or vector images
  • The script is organized in a modular way using Python functions, which facilitates to modify, reuse or extend the code

Update Notifications

Write a Review

User Reviews

Be the first to post a review of GrainSizeTools!

Additional Project Details

Intended Audience


Programming Language



Screenshots can attract more users to your project.
Features can attract more users to your project.

Icons must be PNG, GIF, or JPEG and less than 1 MiB in size. They will be displayed as 48x48 images.