We develop a model of the skin-friction coefficient based on scalar images in the compressible, spatially evolving boundary-layer transition. The images are extracted from a passive scalar field by a sliding window filter on the streamwise and wall-normal plane. The multi-scale and multi-directional geometric analysis is applied to characterize the averaged inclination angle of spatially evolving filtered component fields at different scales ranging from a boundary-layer thickness to several viscous length scales. In general, the averaged inclination angles increase along the streamwise direction, and the variation of the angles for large-scale structures is smaller than that for small-scale structures. Inspired by the coincidence of the increasing averaged inclination angle and the rise of the skin-friction coefficient, we propose a simple image-based model of the skin-friction coefficient. The model blends empirical formulae of the skin-friction coefficient in laminar and fully developed turbulent regions using the normalized averaged inclination angle of scalar structures at intermediate and small scales. The model prediction calculated from scalar images is validated by the results from the direct numerical simulation at two Mach numbers, 2.25 and 6, and the relative error can be less than 15 %.