Change image color

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
rpatelob
Posts: 62
Joined: 2017-04-17T22:17:01-07:00
Authentication code: 1151

Change image color

Post by rpatelob » 2017-06-01T03:36:58-07:00

Is this a bug?
I'm trying to change colour of an image. All colours should be changed except transparent.
Please look at the command.

Code: Select all

convert single_color.png -fuzz 20% -fill red +opaque "#00000000" output.png
#or 
convert single_color.png -fuzz 20% -fill red +opaque transparent output.png
It was working on my previous imagemagick version but after upgraded, it seems to be not working.

Version: ImageMagick 7.0.5-9 Q16 x86_64 2017-06-01 http://www.imagemagick.org

User avatar
fmw42
Posts: 22232
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Change image color

Post by fmw42 » 2017-06-01T09:21:23-07:00

They do two different things.

On IM 7, this should work

Code: Select all

magic single_color.png -fuzz 20% -fill red +opaque "#00000000" output.png
or

Code: Select all

magic single_color.png -fuzz 20% -fill red +opaque none output.png
However, in testing it works fine in IM 6.9.8-7 using convert , but does fail in 7.0.5-8 using magick.

The other command with +opaque, changes all colors but red to transparent

User avatar
fmw42
Posts: 22232
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Change image color

Post by fmw42 » 2017-06-01T09:26:55-07:00

I can confirm this bug in IM 7.0.5.8 Mac OS X when compare to IM 6.9.8.7


# create transparent image

Code: Select all

convert logo: -transparent white logot.png
Image

IM 6:

Code: Select all

convert logot.png -fuzz 10% -fill red +opaque none logot_red6.png
Image

IM7: (makes no change to the image)

Code: Select all

magick logot.png -fuzz 10% -fill red +opaque none logot_red7.png
Image

lettermand
Posts: 1
Joined: 2017-06-01T09:31:34-07:00
Authentication code: 1151

Re: Change image color

Post by lettermand » 2017-06-01T09:39:19-07:00

Also confirmed with 7.0.5.9 on cygwin (and breaks lots of scripts)

User avatar
fmw42
Posts: 22232
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Change image color

Post by fmw42 » 2017-06-01T09:47:35-07:00

I can confirm this also on 7.0.5.9 Mac OSX

User avatar
magick
Site Admin
Posts: 10698
Joined: 2003-05-31T11:32:55-07:00

Re: Change image color

Post by magick » 2017-06-01T11:40:31-07:00

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

rpatelob
Posts: 62
Joined: 2017-04-17T22:17:01-07:00
Authentication code: 1151

Re: Change image color

Post by rpatelob » 2017-06-01T21:51:04-07:00

Thank you for consider it.

Post Reply