[magick-users] having a problem with rotation (transparent bg) after upgrade

Anthony Thyssen anthony at griffith.edu.au
Tue Nov 27 16:05:36 PST 2007


Stas Bekman on  wrote...
| Anthony Thyssen wrote:
| > Stas Bekman on  wrote...
| > | Hi,
| > |
| > | ImageMagick used to make a smooth image rotation before. Now I've
| > | upgraded to the latest version 6.3.7 (same issue with 6.3.2), and now
| > | the rotation leaves a jiggy outline
| > |
| > | Here is the input file:
| > |
| > | in.jpg
| > | http://img2.freeimagehosting.net/image.php?b7174eb966.jpg
| > |
| > | I run:
| > | convert -rotate 5 -background "transparent" in.jpg out.jpg
| > |
| > | here is the output:
| > | http://img2.freeimagehosting.net/image.php?007de57566.jpg
| > |
| > | can you see the border being all messed up now?
| > |
| > Try ordering the arguments right...
| > Also make sure the image has a alpha channel
| >
| >    convert in.jpg -matte -background "transparent" -rotate 5 out.jpg
| >
| > | I need to use transparent background since the image is going to be
| > | composited on top of other images.
| > |
| > | Is there some extra argument that I need to add now? (which I'd imagine
| > | used to be added by default in the past, but it's no longer the case)
| > |
| > See IM examples, Image rotation.
| >   http://imagemagick.org/Usage/distorts/#rotate
|
| I tried all the examples, Anthony. It's not working. It used to work
| just fine before. I haven't touched my code, it just broke after the
| upgrade to the latest IM :(
|
| I even tried:
|
| convert in.jpg -interpolate mesh -filter point -matte -background
| "transparent" -virtual-pixel transparent +distort SRT 5 out.jpg
|
Sorry.  (Smack hand onto forehead)....

You saved the image into JPEG!!!!!
Jpeg can not handle a transparent color!!!!!!

Save it to PNG (still include the -matte operator) and all should be
well.

   convert in.jpg -matte -background "transparent" -rotate 5 out.png

If you need it as JPEG, you will have to flatten it onto a
appropriate colored background, before hand.

  convert in.jpg -matte -background none -rotate 5 \
          -background gray -flatten out.jpg

Or 'underlaying' a checkerboard background...

  convert in.jpg -matte -background none -rotate 5 \
          -size 300x300 pattern:checkerboard -compose dstover -flatten \
          out.jpg

PS:  the color 'none' is the same as 'transparent'

  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 -----------------------------------------------------------------------------
  "The question is, is that a bug or a feature?"  Karl asked.
                                  -- Rick Cook, "The Wizardry Compiled"
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/


More information about the Magick-users mailing list