21Image analysis is widely used to quantify porosity because, in addition to porosity, it can 22 provide quantitative pore system information, such as pore sizes and shapes. Despite its wide 23 use, no standard image analysis workflow exists. When employing image analysis, a 24 workflow must be developed and evaluated to understand the methodological pitfalls and 25 assumptions to enable accurate quantification of total porosity. This study presents an image 26 analysis workflow that is used to quantify total porosity in a range of carbonate lithofacies. 27This study uses stitched BSE-SEM photomicrographs to construct greyscale pore system 28 images, which are systematically thresholded to produce binary images composed of a pore 29 phase and a rock phase. The ratio of the area of the pore phase to the total area of the pore 30 system image defines the total porosity. Image analysis total porosity is compared with total 31 porosity quantified by standard porosimetry techniques (He-porosimetry and Mercury 32 injection capillary pressure (MICP) porosimetry) to understand the systematics of the 33 workflow. The impact of carbonate textures on image analysis porosity quantification is also 34
assessed. 35A comparison between image analysis, He-porosimetry and MICP total porosity indicates 36 that the image analysis workflow used in this study can accurately quantify or underestimate 37 total porosity depending on the lithofacies textures and pore systems. The porosity of 38 wackestone lithofacies tends to be significantly underestimated (i.e. greater than 10 %) by 39 image analysis, whereas packstone, grainstone, rudstone and floatstone lithofacies tend to be 40 accurately estimated or slightly underestimated (i.e. 5 % or less) by image analysis. The 41 underestimation of image analysis porosity in the wackestone lithofacies is correlated to the 42 quantity of matrix pore types and is thought to be caused by incomplete imaging of micro 43 porosity and by non-representative field of views. Image analysis porosity, which is 44 calculated from 2D areas, is comparable with 3D porosity volumes in lithofacies that lack or 45