-resize vs -distort, a colorspace problem?
Posted: 2016-06-12T12:06:28-07:00
Here I convert a (slightly) color image to linear grayscale, resize it, and covert back to sRGB. This works great. When I replace -resize with -distort (for the purpose of adding a rotate and crop/pad, and hopefully higher quality processing), the result is darker. Does anyone know what colorspace magick is going on here?
convert in.png -strip ^
-grayscale Rec709Luminance ^
-resize 50%% ^
-colorspace sRGB ^
-density 118.110 ^
PNG24:out_1.png
convert in.png -strip ^
-grayscale Rec709Luminance ^
-virtual-pixel white -set option:distort:viewport 3300x5100+1925+2780 ^
-distort SRT "0.5 0.12" +repage ^
-colorspace sRGB ^
-density 118.110 ^
PNG24:out_2.png
Usage Example: Resizing with Colorspace Correction
This is the concept I was aiming for, but with grayscale conversion. It mentions -distort as handling colorspace the same as does -resize.
http://www.imagemagick.org/Usage/resize ... colorspace
Test Image:
https://googledrive.com/host/0Bxw3ymi4d ... bXc/in.png
ImageMagick-7.0.1-9-portable-Q16-x64.zip
Version: ImageMagick 7.0.1-9 Q16 x64 2016-06-03
Features: Cipher DPC HDRI
Windows 7 64-bit
convert in.png -strip ^
-grayscale Rec709Luminance ^
-resize 50%% ^
-colorspace sRGB ^
-density 118.110 ^
PNG24:out_1.png
convert in.png -strip ^
-grayscale Rec709Luminance ^
-virtual-pixel white -set option:distort:viewport 3300x5100+1925+2780 ^
-distort SRT "0.5 0.12" +repage ^
-colorspace sRGB ^
-density 118.110 ^
PNG24:out_2.png
Usage Example: Resizing with Colorspace Correction
This is the concept I was aiming for, but with grayscale conversion. It mentions -distort as handling colorspace the same as does -resize.
http://www.imagemagick.org/Usage/resize ... colorspace
Test Image:
https://googledrive.com/host/0Bxw3ymi4d ... bXc/in.png
ImageMagick-7.0.1-9-portable-Q16-x64.zip
Version: ImageMagick 7.0.1-9 Q16 x64 2016-06-03
Features: Cipher DPC HDRI
Windows 7 64-bit