Transparent png -> jpeg artifacts

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
markabey
Posts: 1
Joined: 2012-03-29T05:17:08-07:00
Authentication code: 8675308

Transparent png -> jpeg artifacts

Post by markabey »

When converting this image : http://img41.imageshack.us/img41/6104/alienne.png

using "convert alienne.png out.jpg"

I get some funky artifacts - example image here: http://img198.imageshack.us/img198/5652/outte.jpg

using Ubuntu 10.04
Version: ImageMagick 6.6.2-6 2010-12-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

Also on CentOS 5.6
Version: ImageMagick 6.7.4-8 2012-01-25 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Transparent png -> jpeg artifacts

Post by magick »

Not a bug. Try
  • convert alienne.png -flatten out.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Transparent png -> jpeg artifacts

Post by anthony »

Actually -flatten is the old method... But the requesters version is too old for the newer method :-(

The newer offical method is to use -alpha remove for the correct method. Added IM v6.7.5

See IM examples, Masking and Background Removal, Removing Transparency
http://www.imagemagick.org/Usage/masking/#remove


That is probably one of the most particular looking 'hidden transparency colors' I have seen!
In fact it was probbaly making the PNG much larger that it has any need to be!

You can make your PNG much smaller in size by replacing the areas of hidden color with a solid color. You can do this using -alpha background. This will not change the look of the PNG image, just make the transparent areas of the image compress better.

See Im Examples, Masking and Background Removal, Alpha Background
http://www.imagemagick.org/Usage/maskin ... background

NOTE this does NOT correctly remove transpareny if you save the result to JPEG. Just clean up that hidden 'noise' in the image, to make it compress better.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply