We use calls like
gm compare -density 100 -metric rmse -file bad.png new.ps old.ps
to determine changes in certain PostScript plots. However, the latest gm version now report values that are ~1/256 of the previous results. Before (e.g., 1.3.12 is what I can show, but I suspect it was OK in 1.3.18 too), the output might have said
Image Difference (RootMeanSquaredError):
Normalized Absolute
============ ==========
Red: 0.0253754315 1663.0
Green: 0.0253754315 1663.0
Blue: 0.0253754315 1663.0
Total: 0.0253754315 1663.0
but in 1.3.19 we get
Normalized Absolute
============ ==========
Red: 0.0253809569 6.5
Green: 0.0253809569 6.5
Blue: 0.0253809569 6.5
Total: 0.0253809569 6.5
I have attached a zip file with old.ps and new.ps. You can see the two legends are different but gm no longer flags these as different since the absolute RMSE values have changed by ~256. This is on OSX Mavericks with gm via macports.
It is suspicious that 1663.0/6.5 ~ 256 and perhaps that might help you pinpoint the issue.
Are you testing a Q8 build versus a Q16 build? Run "gm | head -2" to find out.
Note that the normalized values in the report are about the same (.02358 versus .025375).
On Mon, 20 Jan 2014, Glenn Randers-Pehrson wrote:
Yes, this does seem like a Q8 vs Q16 build issue (old Q16, new Q8).
The absolute values are only meaningful if the pixel quantum values
support the same range. That is why normalized values are provided as
well.
Check the first line of output from 'gm -version' to see the build
depth.
Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Hm, not sure where build depth is reported. Here is the full gm -version output that I get:
GraphicsMagick 1.3.19 2013-12-31 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2013 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP yes
DPS no
FlashPix no
FreeType yes
Ghostscript (Library) no
JBIG no
JPEG-2000 yes
JPEG yes
Little CMS yes
Loadable Modules no
OpenMP no
PNG yes
TIFF yes
TRIO no
UMEM no
WMF no
X11 no
XML yes
ZLIB yes
Host type: x86_64-apple-darwin13.0.0
Configured using the command:
./configure '--prefix=/opt/local' '--with-jbig=no' '--with-jpeg=yes' '--with-wmf=no' '--with-dps=no' '--with-gslib=no' '--with-lcms=no' '--with-lcms2=yes' '--with-x=no' '--with-perl=no' '--with-trio=no' '--with-jp2=yes' '--with-fpx=no' '--with-png=yes' '--with-tiff=yes' '--with-bzlib=yes' '--with-lzma=yes' '--with-zlib=yes' '--with-xml=yes' '--with-ttf=yes' '--without-included-ltdl' '--without-umem' '--enable-shared=yes' '--with-quantum-depth=8' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -Os -arch x86_64' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64' 'CPPFLAGS=-I/opt/local/include' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-pipe -Os -arch x86_64'
Final Build Parameters:
CC = /usr/bin/clang
CFLAGS = -pipe -Os -arch x86_64 -Wall -D_THREAD_SAFE
CPPFLAGS = -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/libxml2
CXX = /usr/bin/clang++
CXXFLAGS = -pipe -Os -arch x86_64 -D_THREAD_SAFE
LDFLAGS = -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -L/opt/local/lib -L/opt/local/lib
LIBS = -llcms2 -ltiff -lfreetype -ljasper -ljpeg -lpng16 -llzma -lbz2 -lxml2 -lz -lm -lpthread
On Tue, 21 Jan 2014, Paul Wessel wrote:
It is the 'Q8' in the first line of output.
Change '--with-quantum-depth=8' to '--with-quantum-depth=16' in the
configure options to make that be 'Q16'. Then the results should be
similar.
If you still have access to the executable of the previous build you
can compare your configuration options with the ones used for the
previous build.
Bob
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
I dont have the previous build but the version that runs on my old SnowLeopard server (gm 1.3.12) shows --with-quantum-depth=16. I am not sure how the GM teams sees this issue. To me it feels like a bug. Are you saying that it is a "feature", i.e., it is OK that output changes given the different build depths? Or that the "Absolute" is not guaranteed to be the same for different builds and that one should base decisions on the Normalized values? At some point macports decided to build gm with a different build depth and presumably could change that in the future. What to do?
On Tue, 21 Jan 2014, Paul Wessel wrote:
I am sorry that I did not notice this message before.
Postscript is only 8-bits per sample so in most cases 8-bits per
sample is sufficient and the output will be the same as the input.
If there is any image processing done, and particularly color
management or adjustment of levels, then 16-bits may offer significant
improvement if the output is saved at 16-bits/sample. Without any
image processing, it is expected that 8-bit input produces 8-bit
output with no change.
GraphicsMagick uses Ghostscript to read Postscript so any version
difference in Ghostscript can be expected to result in somewhat
different output. Postscript is rendered (e.g. lines and circles) and
is not a pixel-oriented format so any difference at all in the
rendering will produce different output.
Bob
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
gm | head -2
GraphicsMagick 1.3.19 2013-12-31 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2013 GraphicsMagick Group.
Yes, the normalized values are about the same so we could rewrite scripts to use those instead. The bad.png shows the correct difference. But something changed regarding the absolute values. We noticed there is a new -maximum-error option which might be a better way in the future.
This issue has been determined to be a misunderstanding of expected results and is not due to a bug.