
Hi there,
For the problem 2, I mean I need a raw image buffer **with png format** including header and not just pixels. png_io's png_write_view only writes png format to file. I must pass that data to other library to do something. If I write png to file than read it to memory then pass it, it might be too slow.
How to do that?
The PNG extension is using libpng which will transform the data into the png format. Though there is no straightforward way to have access to the png image buffer. Unless you write the file and reopen.
For the problem 3, If I can make sure that two images **always** have the same format (png), the same size, the same layout of the channels, and the same channel depth...etc. Is there any good performance way to do that?
Well byte by byte comparison is the fastest without doing any crazy optimization. Use memcmp if possible.
I am not sure that to compute Mean Absolute Error is the best way to do that. I just simply follow the recommendation of ImageMagicks (http://www.imagemagick.org/Usage/compare/). But after this review, I found MAE is used to compute "how different are two images"... oh, actually, I don't need to know how difference, I just want to know two images are different. :(
That what I was thinking. Christian