Thread counting algorithms seek to determine the vertical and horizontal weave densities of the canvas underlying a painting. X-ray images of a painting serve as the raw data. Canvas texture can be modeled as a sum of two sinusoids having nearly orthogonal spatial frequencies. The actual painting serves as an additive signal that only distracts from the thread-counting process. The algorithm employs a variant of short-time Fourier analysis to the image domain. In simple cases, two-dimensional Fourier transforms of small areas reveal isolated peaks at the proper vertical and horizontal frequencies. In more challenging cases, even within the same painting, additional peaks appear in the expected frequency range, requiring heuristics to extract from the spectral measurements representative thread-count estimates for a painting. The resulting algorithm, while still under development, can analyze weave density for entire paintings with an accuracy comparable to human measurements.