Inefficient compression of CMYK images
Posted: 2018-04-25T01:17:49-07:00
ImageMagick does not seem to efficiently compress TIFF CMYK images. Photoshop manages to Zip/LZW compress the same images to about 1/10 the size of what ImageMagick outputs.
If I create an LZW-compressed RGB TIFF with ImageMagick of a full rainbow gradient:
The results are:
But if I create it as CMYK instead of RGB (or rather, convert it before output):
The results are:
and Adobe Photoshop CC 2015.5 17.0.0
If I create an LZW-compressed RGB TIFF with ImageMagick of a full rainbow gradient:
Code: Select all
convert -size 8500x5000 \
-define gradient:angle=60 gradient:'#FFF-#0FF' \
-set colorspace HSB -colorspace sRGB \
-depth 8 \
-compress LZW \
~/out-rgb.tif
- Output file size: 4.2MB
- Photoshop re-save: 4.5MB
- With `-compress none` or no `-compress` at all: 122MB
But if I create it as CMYK instead of RGB (or rather, convert it before output):
Code: Select all
convert -size 8500x5000 \
-define gradient:angle=60 gradient:'#FFF-#0FF' \
-set colorspace HSB -colorspace sRGB \
-colorspace CMYK \
-depth 8 \
-compress LZW \
~/out-cmyk.tif
- Output file size: 77MB (already weird, for having just added one extra channel)
- Photoshop re-save: 5.9MB
- With `-compress none` or no `-compress` at all: 162MB
- Output file size: 10MB (much better than LZW’s 77MB, but still humongous compared to the next bullet point)
- Photoshop re-save: 0.83MB (!)
Code: Select all
$ magick -version
Version: ImageMagick 7.0.7-28 Q16 x86_64 2018-04-17 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg lcms ltdl lzma png tiff xml zlib