you can use ImageJ software with different intensity option. it will also help you study different grain size of different compounds in a particular area.
If you have MATLAB you can use a free open source add on called MTEX which can be downloaded from here: https://mtex-toolbox.github.io/
Their website has very useful tutorials to calculate the grain size, whichever way you like by area or by intersect. You can see both examples in our recent paper:
Article The role of microstructure on wear mechanisms and anisotropy...
In case of elongated grains, You need to determine the averaged grain size for different directions (longitudinal, transverse, and planar for rectangular samples or longitudinal and radial for round samples, etc.). Find ImageJ tutorial for determination of average grain size in one direction and find ASTM instructions for measurement instructions. Remember, for each sample direction You will find grain size distribution instead of the single grain size. However, You can always represent grain size as a most probable (frequent) value from the grain size distribution diagram plus/minus some less probable value.