A new method of digital image analysis can quantify pore parameters over more than three orders of magnitude, from a submicron to a millimeter scale. This porosity characterization does not require knowledge of lithology, age, burial depth, or diagenesis of the sample. The method is based on digital analyses of images from thin sections at variable magnifications taken under an optical microscope (OM) and under an environmental scanning electron microscope (ESEM). The results help explain variations in permeability for carbonate samples with a variety of complex pore structures. The analyses, however, can be done on any thin sections of other rock types. The OM images provide macroporosity information, whereas the ESEM images yield information on microporosity. The boundary between macroporosity and microporosity is defined at a pore area of 500 micrometers 2 , which translates to a pore length of approximately 20 micrometers, which is roughly the thickness of a thin section and thus the resolution of the OM. The digitized thin-section images are binarized into a macropore and a matrix phase (OM) or a micropore and a solid phase (ESEM). A standard digital image analysis program is used to detect all individual pores and to measure pore area and pore perimeter. Based on these analyses, one can calculate for each sample the amount of macroporosity, the amount of microporosity within the matrix (intrinsic microporosity), the shapes of the macropores (perimeter over area), and the pore size distribution. Comparison of total porosity determined from plugs indicates that macroporosity and microporosity values based on this methodology match the plug data, confirming the validity of the method. The combination of macroporosity and microporosity data yields pore size distribution and pore shape information that can explain the distribution of physical properties, in particular permeability. In parameter sensitivity analyses using neural networks, permeability appears to be mainly controlled by the macropore shape in high-permeability samples, and by the amount of intrinsic microporosity in the low-permeability samples.