Page 1 of 1

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

Posted: 2013-10-01T10:50:55-07:00
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:

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

Posted: 2013-10-01T11:02:33-07:00
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)

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

Posted: 2013-10-01T11:12:06-07:00
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.

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

Posted: 2013-10-01T11:23:09-07:00
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:

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

Posted: 2013-10-01T11:47:55-07:00
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.

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

Posted: 2013-10-01T12:20:33-07:00
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.

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

Posted: 2013-10-01T14:03:21-07:00
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