PPM image manipulation functions.