A context-based scanning technique for images is presented. An image is scanned along a context-based space filling curve that is computed so as to exploit inherent coherence in the image. The resulting one-dimensional representation of the image has improved autocorrelation compared with universal scans such as the PeanoHilbert space filling curve. An efficient algorithm for computing context-based space filling curves is presented. We also discussthe potential of improvedautocorrelationof context-basedspace filling curvesfor image and video lossless compression.