Code: Select all
/opt/local/bin/convert -version
Version: ImageMagick 6.7.9-0 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenCL HDRI
/usr/local/bin/convert -version
Version: ImageMagick 6.7.6-9 2012-05-12 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:
The first one is my 'regular' one (and the newest available), installed via MacPorts (and it's dynamically linked)
The second one is from ... I can't remember (it's definitely not built locally), but it's statically linked.
Anyways, I've been running these two commands, and discovered that they produced quite a different type of output, which is very strikingly visible:
Code: Select all
/usr/local/bin/convert screenshot.jpeg -type grayscale grayscale-6.7.6-9.png
/opt/local/bin/convert screenshot.jpeg -type grayscale grayscale-6.7.9-0.png
So I look for the differences:
Code: Select all
identify -verbose grayscale-6.7.6-9.png > grayscale-6.7.6-9.txt
identify -verbose grayscale-6.7.9-0.png > grayscale-6.7.9-0.txt
sdiff -sbB -w 150 grayscale-6.7.6-9.txt grayscale-6.7.9-0.txt > diff.txt
cat diff.txt
Image: grayscale-6.7.6-9.png | Image: grayscale-6.7.9-0.png
Resolution: 28.34x28.34 | Resolution: 72x72
Print size: 12.35x14.2555 | Print size: 4.86111x5.61111
Units: PixelsPerCentimeter | Units: PixelsPerInch
Type: Palette | Type: Grayscale
> Base type: Grayscale
Colorspace: sRGB | Colorspace: RGB
red: 8-bit | gray: 8-bit
green: 8-bit <
blue: 8-bit <
Red: | Gray:
mean: 200.265 (0.785352) | mean: 164.009 (0.643174)
standard deviation: 57.0152 (0.223589) | standard deviation: 66.6053 (0.261197)
kurtosis: 2.87636 | kurtosis: 0.57041
skewness: -1.92907 | skewness: -1.08054
Green: <
min: 0 (0) <
max: 255 (1) <
mean: 200.265 (0.785352) <
standard deviation: 57.0152 (0.223589) <
kurtosis: 2.87636 <
skewness: -1.92907 <
Blue: <
min: 0 (0) <
max: 255 (1) <
mean: 200.265 (0.785352) <
standard deviation: 57.0152 (0.223589) <
kurtosis: 2.87636 <
skewness: -1.92907 <
Image statistics: <
Overall: <
min: 0 (0) <
max: 255 (1) <
mean: 200.265 (0.785352) <
standard deviation: 57.0152 (0.223589) <
kurtosis: 2.87636 <
skewness: -1.92907 <
597: ( 0, 0, 0) #000000 black | 810: ( 0, 0, 0) #000000 rgb(0,0,0)
90: ( 1, 1, 1) #010101 srgb(1,1,1) | 62: ( 1, 1, 1) #010101 rgb(1,1,1)
[..............]
[...skipping...]
[..............]
254: (254,254,254) #FEFEFE srgb(254,254,254) | 254: (254,254,254) #FEFEFE rgb(254,254,254)
255: (255,255,255) #FFFFFF white | 255: (255,255,255) #FFFFFF rgb(255,255,255)
Rendering intent: Perceptual | Rendering intent: Undefined
Gamma: 0.45455 | Gamma: 1
Chromaticity: <
red primary: (0.64,0.33) <
green primary: (0.3,0.6) <
blue primary: (0.15,0.06) <
white point: (0.3127,0.329) <
Background color: white | Background color: rgb(255,255,255)
Border color: srgb(223,223,223) | Border color: rgb(223,223,223)
Matte color: grey74 | Matte color: rgb(189,189,189)
Transparent color: black | Transparent color: rgb(0,0,0)
Orientation: Undefined | Orientation: TopLeft
date:create: 2012-08-18T04:24:48+02:00 | date:create: 2012-08-18T04:24:51+02:00
date:modify: 2012-08-18T04:24:48+02:00 | date:modify: 2012-08-18T04:24:51+02:00
> exif:ExifImageLength: 404
> exif:ExifImageWidth: 350
> exif:ExifOffset: 90
> exif:Orientation: 1
> exif:ResolutionUnit: 2
> exif:XResolution: 72/1
> exif:YResolution: 72/1
png:cHRM : chunk was found (see Chromaticity, abov | png:gAMA : gamma=1 (See Gamma, above)
png:gAMA : gamma=0.45454544 (See Gamma, above) <
png:sRGB : intent=0 (Perceptual Intent) | png:text : 5 tEXt/zTXt/iTXt chunks were found
png:text : 4 tEXt/zTXt/iTXt chunks were found | png:text-encoded profiles: 1 were found
signature: e76c50c69201379387a2e7a3e8e36a49aede3b5f38f2fe20763f7d7 | signature: 30fa3d6441cf466e3a6edd76f5d746b80852efb2900bbe6fa271f8a
> Profiles:
> Profile-exif: 126 bytes
filename: grayscale-6.7.6-9.png | filename: grayscale-6.7.9-0.png
Filesize: 27.1KB | Filesize: 29.3KB
Pixels per second: 14.14MB | Pixels per second: 0B
Elapsed time: 0:01.009 | Elapsed time: 0:01.000
- Are these changes for the 'simple' grayscaling operation between my 2 IM versions intentional and a well-known fact?
- What can I do in the future to get early notification if something that fundamental changes? Is there a comprehensive ChangeLog available somewhere? (On the one hand I'd like to run the newest and officially recommended version with the latest improvements and bugfixes -- on the other hand I'd like my scripts to keep working...)
- Also note, how the newer version 6.7.9-0 doesn't indicate a valid value for 'Pixels per second' while the older one did.
UPDATE:
The reason why this did bite me is this commandline:
Code: Select all
convert screenshot.jpeg \
-scale 1000% \
-blur 1x65535 -blur 1x65535 -blur 1x65535 \
-contrast \
-normalize \
-despeckle -despeckle \
-type grayscale \
-sharpen 1 \
-posterize 3 \
-negate \
-gamma 100 \
-scale 10% \
b+w.png
The original screenshot was from an iPad: