Menu

#297 GM distorts image using -transform

v1.0_(example)
closed-fixed
None
5
2015-05-09
2015-04-10
No

I am trying to do a affine transform, but GM totally messes up the image. I attached a test .cmd script along with the image in question. The second line shows that it has nothing to do with the -affine, just -transform is enough to reproduce the problem.
Using ImageMagick the same command works fine, but IM is dramatically slow compared to GM, and now I have to run 2 libraries side by side using IM4Java.

1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2015-04-12

    The problem has something to do with -transform in conjunction with Group 4 TIFF compression. The default is to preserve the original compression if possible.

    After investigation I found that -transform has added a matte channel to the image. I added '+matte' (i.e. remove support for transparency) before the output file name, and the problem went away. The matte channel is not needed because the image is completely opaque.

    The bug seems to be that GraphicsMagick enabled an alpha channel which did not exist before, and is adding an 'extra sample' to support matte but Group4 (and Group3) compression don't support it. Add '+matte' before the output file name and the problem goes away.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-05-09
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-05-09

    The problem with corrupted TIFF if matte is enabled for compression types which do not support it is fixed by Mercurial changeset 14590:81b3de435b2e. Now matte is automatically removed when it should be. Thank you very much for reporting the issue.

     

Log in to post a comment.