Page 1 of 1

Magick++ tiff loses compression

Posted: 2014-03-06T14:51:06-07:00
by ths71
on current IM 6.8.8.7, when you do

Code: Select all

image.read("group4.tif");
image.write("test.tif");
the resulting image is not compressed anymore.

if you insert

Code: Select all

image.compressType(image.compressType());
it has indeed the same compression as the source.

i traced this back to this change:
http://trac.imagemagick.org/changeset/1 ... ers/tiff.c
which in my opinion doesn't make any sense.

in

Code: Select all

    compression=UndefinedCompression;  
    if (image_info->compression != UndefinedCompression)  
      compression=image_info->compression;  
the first two lines are redundant, anyway.

Re: Magick++ tiff loses compression

Posted: 2014-03-06T15:14:41-07:00
by fmw42
There was a decision made at that time to not pass on the compression, so as not to decompress and recompress, esp with JPG compression, and thus lose more quality.

Re: Magick++ tiff loses compression

Posted: 2014-03-06T20:46:29-07:00
by susannamoore
When it comes to TIFF, two main image compression options are available–they’re known as LZW or ZIP. Both ZIP and LZW are lossless compression methods. That means that no data is being lost in the image compression[/color][/url] process, unlike a lossy format like JPG. But there are two main reasons you might not to use ZIP or LZW compression. Because they require more processing to open and close them, compressed TIFF files can be a little slower to work with.

Re: Magick++ tiff loses compression

Posted: 2014-03-07T03:02:03-07:00
by ths71
that's all well and good, but if you want to change compression, it's easy to do so. if you want to retain the settings of the original, not changing anything is the intuitive thing.

image.compressType(image.compressType());

is not a code that seems like it should do anything, but it does.

Re: Magick++ tiff loses compression

Posted: 2014-05-15T04:02:40-07:00
by dlemstra
I just committed a patch for this that only make sure that jpeg compression is not used when converting jpeg to tiff. The next release of ImageMagick (6.8.9-2) will include this fix.