Petrographic description is one of the primary methods by which geoscientists develop an understanding of geologic systems and constrain source, reservoir, and seal characteristics. Geologic facies or rock types are routinely interpreted from petrographic features in thin sections, but these methods are time consuming and tedious. The interpretations can be heavily biased. Variations in experience base, microscope quality, and scale of observation can lead to inconsistent interpretations, absorbing costly time to achieve alignment. With advances in computing, millions of images can be analyzed in seconds through signal-processing technologies. With this capability, machine-learning methods can support geologic pattern identification to classify geologic features. Combined, automated image analysis and classification though machine learning can significantly reduce analysis time, interpreter bias and inconsistencies. These methods make it possible to share "expert knowledge" with nonexpert users. Image processing, segmentation and classification are key workflows for translating geologic features into discrete representations that can be used for computational modeling. Here, we present two examples where advanced image analysis and machine learning are used to predict geologic and petrophysical properties from optical microscopy thin-section images. The first example uses multiple machine-learning algorithms and pore geometries as a means for predicting and classifying rock properties, such as lithofacies, reservoir zone, porosity and permeability. The second example focuses on training and using convolutional neural networks to classify and predict Dunham textures (mudstone, wackestone, packstone and grainstone) from carbonate thin sections. Data for both machine-learning applications comes from a Jurassic bimodal carbonate reservoir. Key depositional lithofacies include micritic mudstones, bivalve-coated grain pack/grainstones, Cladocoropsis pack/grainstones, stromatoporoid coralgal pack/grainstones, and skeletal-oolitic grainstones. Key geological features, pore fabric analysis and depositional textures were documented via optical light microscopy. In addition, standard petrophysical measurements (porosity, permeability and grain density) were available from the corresponding core plugs. Although several key uncertainties exist in using machine-learning models for prediction of geological and petrophysical features, these two examples highlight the potential for combining advanced image analysis and data-driven analytical techniques. These approaches can be extended to other multiscale, multidimensional imaging applications in geoscience, such as core and borehole imaging, CT scanning, LIDAR and hyperspectral imaging.