[RESOLVED]possible bug -opaque none IM 6.8.7.0 Q16 Mac OSX

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

[RESOLVED]possible bug -opaque none IM 6.8.7.0 Q16 Mac OSX

Post by fmw42 »

Neither of the following seem to turn transparency to black (or to any other color). It goes back at least as far as 6.8.6.9 which is currently the farthest back I can test.

convert logo: -transparent white -fill black -opaque none show:
convert logo: -transparent white -fill "rgba(0,0,0,1)" -opaque none show:
Last edited by fmw42 on 2013-10-01T11:21:06-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug -opaque none IM 6.8.7.0 Q16 Mac OSX

Post by snibgo »

As far as I know, "-fill black -opaque none" never turned transparent-black into opaque-black (or any other colour). This ...

Code: Select all

convert xc:None -fill Black -opaque none txt:
... returns transparent black for a large number of versions, back to v6.5.8.

EDIT: "-fill red -opaque None" seems to turn all fully-transparent pixels into transparent red. Eg:

Code: Select all

D:\web\im>"%IM%convert" xc:None xc:rgba(100%,100%,100%,0) -append -fill red -opaque none txt:
# ImageMagick pixel enumeration: 1,2,65535,srgba
0,0: (100%,0%,0%,0)  #FFFF000000000000  srgba(255,0,0,0)
0,1: (100%,0%,0%,0)  #FFFF000000000000  srgba(255,0,0,0)
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -opaque none IM 6.8.7.0 Q16 Mac OSX

Post by fmw42 »

My workaround was to use

-background black -alpha background -alpha off

I am reasonably sure however that it used to work as I have scripts that use the concept to turn everything not trasparent to one color and then everything that is transparent to some other color.


I would have thought that if it was an issue with just black, then my work around is fine, but it fails for other colors (red here below).

The fails:
convert logo: -transparent white -fill red -opaque none show:

Snibgo, I just saw your edit above. So it looks like I just need to turn off alpha at the end.

This works:
convert logo: -transparent white -fill red -opaque none -alpha off show:


So this is a new behavior, though I do not know when it changed.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [RESOLVED]possible bug -opaque none IM 6.8.7.0 Q16 Mac O

Post by fmw42 »

Looking back at my old scripts, I see it needs -channel rgba to work the way I expected.

So this works
convert logo: -channel rgba -transparent white -fill red -opaque none show:

as does this:
convert logo: -channel rgba -transparent white -fill white +opaque none -fill black -opaque none show:
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: [RESOLVED]possible bug -opaque none IM 6.8.7.0 Q16 Mac O

Post by snibgo »

"-channel rgba" changes the behaviour of fill: when it replaces a pixel, it will also replace the alpha value from the alpha value of the fill colour.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [RESOLVED]possible bug -opaque none IM 6.8.7.0 Q16 Mac O

Post by fmw42 »

You are probably right in that it was a -fill issue and not an opaque issue. So the title was also in error.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: [RESOLVED]possible bug -opaque none IM 6.8.7.0 Q16 Mac O

Post by snibgo »

Well, it depends on the operation that is using a fill colour. For example, with "label:", "-channel rgba" doesn't make a difference; the alpha from fill is always used.

Code: Select all

D:\web\im>%IM%convert -size 400x600 {-channel rgba} -background green -fill rgba(100%,0,0,0.25) label:snibgo s.png
snibgo's IM pages: im.snibgo.com
Post Reply