Improve pointer conversion for PNG data
Improve pointer conversion for PNG data

Since the format of pointers used by libpng (an array of pointers to
each row) is also used in writing, it was moved to a separated routine
to be reused.

tessarin/dither