AffineProjection causes subtle color shifts
Posted: 2018-10-24T14:56:50-07:00
When I perform a convert -distort AffineProjection that only translates, the resulting image is subtly different in color from an equivalent -crop operation. Following are the commands issued and the results of a compare.
+ convert -version
Version: ImageMagick 7.0.8-9 Q16 x86_64 2018-08-04 https://www.imagemagick.org
. . .
+ identify t4.tiff
t4.tiff TIFF 4000x3000 4000x3000+0+0 16-bit sRGB 74.6194MiB 0.010u 0:00.000
+ convert t4.tiff -crop 1250x1100+1080+170 t4.crop.tiff
+ convert t4.tiff -distort AffineProjection 1,0,0,1,-1080,-170 -crop 1250x1100+0+0 t4.tran.tiff
+ compare -verbose -fuzz .1% -metric MAE t4.crop.tiff t4.tran.tiff t4.diff.tiff
t4.crop.tiff TIFF 1250x1100 1250x1100+1080+170 16-bit TrueColor sRGB 8.03736MiB 0.120u 0:00.120
t4.tran.tiff TIFF 1250x1100 1250x1100+0+0 16-bit TrueColor sRGB 8.39158MiB 0.100u 0:00.099
Image: t4.crop.tiff
Channel distortion: MAE
red: 32.6865 (0.000498764)
green: 29.2526 (0.000446366)
blue: 29.4457 (0.000449313)
alpha: 0 (0)
all: 22.8462 (0.000348611)
t4.crop.tiff=>t4.diff.tiff TIFF 1250x1100 1250x1100+1080+170 16-bit sRGB 6.83525MiB 0.310u 0:00.309
This is on MacOS High Sierra. The diff image shows differences concentrated around shifts in color in the original image. Am I expecting too much fidelity from an AffineProjection ? Any thoughts would be appreciated.
+ convert -version
Version: ImageMagick 7.0.8-9 Q16 x86_64 2018-08-04 https://www.imagemagick.org
. . .
+ identify t4.tiff
t4.tiff TIFF 4000x3000 4000x3000+0+0 16-bit sRGB 74.6194MiB 0.010u 0:00.000
+ convert t4.tiff -crop 1250x1100+1080+170 t4.crop.tiff
+ convert t4.tiff -distort AffineProjection 1,0,0,1,-1080,-170 -crop 1250x1100+0+0 t4.tran.tiff
+ compare -verbose -fuzz .1% -metric MAE t4.crop.tiff t4.tran.tiff t4.diff.tiff
t4.crop.tiff TIFF 1250x1100 1250x1100+1080+170 16-bit TrueColor sRGB 8.03736MiB 0.120u 0:00.120
t4.tran.tiff TIFF 1250x1100 1250x1100+0+0 16-bit TrueColor sRGB 8.39158MiB 0.100u 0:00.099
Image: t4.crop.tiff
Channel distortion: MAE
red: 32.6865 (0.000498764)
green: 29.2526 (0.000446366)
blue: 29.4457 (0.000449313)
alpha: 0 (0)
all: 22.8462 (0.000348611)
t4.crop.tiff=>t4.diff.tiff TIFF 1250x1100 1250x1100+1080+170 16-bit sRGB 6.83525MiB 0.310u 0:00.309
This is on MacOS High Sierra. The diff image shows differences concentrated around shifts in color in the original image. Am I expecting too much fidelity from an AffineProjection ? Any thoughts would be appreciated.