Canopy structure can be estimated using gap fraction (GF) data, which can be directly measured with hemispherical photography. However, GF data accuracy is affected by sunlit canopy, multiple scattering, vignetting, blooming, and chromatic aberration. Here, we present an algorithm to classify hemispherical photography, whose aim is to reduce errors in the extraction of GF data. The algorithm, which was implemented in free software, uses color transformations, fuzzy logic, and object-based image analysis. The results suggest that color and texture, rather than only brightness, can be used to extract GF data.