Reduce memory consumption of simple black and white images.
Merge pull request #4181 from nnethercote/compact-images

Reduce memory consumption of simple black and white images.