In recent years, merocyanine photoacids have been utilized to control various chemical processes using visible light and have found applications in materials, energy, and biomedical areas. Molecular merocyanine photoacids are commonly used in the previous works. Covalently linking the photoacids to polymers improves their compatibility with different media, avoids leakage problems, and allows a localized proton concentration to be produced. However, the phenolic and indolinium moieties of the photoacids make them difficult to be polymerized with common methods. In this work, the monomer of a merocyanine photoacid is converted to a spiropyran in situ by adding trimethylamine to a dimethyl sulfoxide (DMSO) solution of the monomer. Free radical polymerization yields the polymers of the spiropyran, which is acidified to regenerate the photoacid. The photoacid polymers prepared show good solubility, photoacidity, and reversibility. Irradiating a thin film of a photoacid polymer doped with methyl orange through a mask copies the pattern of the mask to the film. The pattern can be erased by heating the film at 80 °C for 10 min, and a new pattern is created by irradiation through a different mask.