// returns a new w by h image, all black; the caller frees it
unsigned char * new_image(int w, int h);

// writes the color r, g, b at *p, and moves *p on to the next pixel
void put_pixel(unsigned char ** p, int r, int g, int b);

// writes the w by h image px to the output as a P6 file
void write_ppm(unsigned char * px, int w, int h);

// returns a new image read as a P6 file from the input, and sets *w and *h to its size; the caller frees it
unsigned char * read_ppm(int * w, int * h);
