This paper presents a method, generalization to interval, that can encode images into symbolic expressions. This method generalizes over instances of spatial patterns, and outputs a constraint program that can be used declaratively as a learned concept about spatial patterns, and procedural as a method for reasoning about spatial relations. Thus our method transforms numeric spatial patterns to symbolic declarative/procedural representations. We have implemented generalization to interval with Acorn,^ a system that acquires knowledge about spatial relations by observing 2-D raster images. We have applied this system to some layout problems to demonstrate the ability of the system and the flexibility of constraint programs for knowledge representation.