IM replace opaque color by transparency color.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Fromen
Posts: 3
Joined: 2012-11-12T06:12:53-07:00
Authentication code: 67790

IM replace opaque color by transparency color.

Post by Fromen »

I work in Windows XP and use IM-6.8.0-Q16. And I want to reduce number of the image http://www.keeshond.com.ua/wp-content/u ... %D1%82.gif unique colors (to 4 colors). For this I use a next command: "convert input_file.gif +dither -colors 4 output_file.gif". After executing of this command the output file contains a dog with a white nose.
But when I installed IM-6.3.9-Q16 the output file has been good, without replacing opaque colors by transparency background.
What the difference between the versions and why they return different results?
Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM replace opaque color by transparency color.

Post by fmw42 »

This works fine for me on Mac OSX Snow Leopard IM 6.8.0.4 Q16

convert 1dog.gif -alpha off +dither -colors 4 -alpha on 1dog_tmp1.gif


Many things have changed since your old 6.3.9 version of IM. That version is over 400 versions old.
Fromen
Posts: 3
Joined: 2012-11-12T06:12:53-07:00
Authentication code: 67790

Re: IM replace opaque color by transparency color.

Post by Fromen »

fmw42, thanks a lot for reply. It works fine. But I think that this solution is not a good practice (off the transparency, reduce colors, on the transparency. I am afraid the performance losing). In my opinion IM must to solve problems with tranparently images. Or am I wrong?
Fromen
Posts: 3
Joined: 2012-11-12T06:12:53-07:00
Authentication code: 67790

Re: IM replace opaque color by transparency color.

Post by Fromen »

I note that for png it can not work (see http://assets.tumblr.com/images/logo.png?alpha&6). May be it's depends on png multi-alpha-color?
Post Reply