----- Original Message -----
From: "Werner LEMBERG" <w...@gnu.org>
To: <m...@philholmes.net>
Cc: <m...@mikesolomon.org>; <d...@gnu.org>; <lilypond-devel@gnu.org>
Sent: Sunday, March 03, 2013 7:06 AM
Subject: Re: Alternative pixel-based regtest checker
I know from my Windows pixel-based checker that, generally, the PNG
files contain the same image, version after version (there are a few
oddities with some text, which I'm used to). I would have believed
that identical images would only be produced by identical PNG files?
Usually, picture container formats like PNG also contain metadata like
the date of image creation or a comment. This makes PNGs different
even in case the contained images are identical.
Additionally, it's possible that identical images are stored in
different formats, for example, a B/W image can be stored either as a
1-bit bitmap or an 8-bit pixmap.
However, you could convert PNG images temporarily to the PGM format
to compute a hashsum: PGM doesn't have metadata.
http://en.wikipedia.org/wiki/Netpbm_format
The program to do this is `pngtopnm', probably followed by a call to
`pgmtopgm' to assure that B/W images are handled as grayscale images
too:
pngtopnm image.png \
| pgmtopgm \
| md5sum -b > image.md5
Werner
I did some more looking at this last night, but didn't have time to post the
results. There were lots of differences in a couple of PNG files which
appeared identical visually. I actually converted them to bitmaps and found
there were six pixels different, to the tune of 1/255 in brightness - so
they were effectively the same. I assume the PNGs were so different because
of the way the compression algorithm works. It's certainly not meta data in
these files - most comparisons show 2 files created by different lilypond
versions to be byte-identical.
I've done some more work on the comparison and will post an update once it's
worth demonstrating. Not sure when that will be - rehearsing and college
work is pressing.
--
Phil Holmes
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel