possible bug gradient with transparency IM 6.8.5.6 Q16 Mac

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

Re: possible bug gradient with transparency IM 6.8.5.6 Q16 M

Post by fmw42 »

OK. But see my previous posts about the notes in red.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug gradient with transparency IM 6.8.5.6 Q16 M

Post by anthony »

red disappears too quickly and leave too much of the image transparent
Actually it doesn't -- it becomes a red-grey which to us looks more transparent than it is. Especially if overlaid on grey, or white backrgound for display.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug gradient with transparency IM 6.8.5.6 Q16 M

Post by fmw42 »

Look at all three image from that post and you will see if you compare them that they are all different and the first two do not match the properly created gradient.

I am more interested in being able to produce a proper multi-stop gradient using a 2D black-white gradient and colorizing with a 1D multicolor (with at least some transparency) using -clut.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug gradient with transparency IM 6.8.5.6 Q16 M

Post by anthony »

Remember...
alpha is linear... color is non-linear.

It is very very hard to compare alpha and color gradients!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug gradient with transparency IM 6.8.5.6 Q16 M

Post by fmw42 »

why are these two not equivalent:

convert \( -size 256x50 xc:red \) \
\( -size 50x256 gradient: -rotate -90 +write show: \) \
-alpha off -compose copy_opacity -composite show:

convert -size 50x256 gradient:red-none -rotate -90 show:

Since if I remove the alpha on the latter I get a red base image, which is just what I create in the first one.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug gradient with transparency IM 6.8.5.6 Q16 M

Post by anthony »

because it would not handle something like...

gradient:red-{half-transparent-blue}

correctly.

Actually I which you could use something like alpha(blue,0.5) where 'blue' is any color name.


Note the red-blue gradient in each of these is different according to the '4D Cubic-Cone' colorspace
convert -size 30x500 gradient:'red-rgba(0,0,255,1)' -rotate 90 -alpha off show:
convert -size 30x500 gradient:'red-rgba(0,0,255,0.7)' -rotate 90 -alpha off show:
convert -size 30x500 gradient:'red-rgba(0,0,255,0.5)' -rotate 90 -alpha off show:
convert -size 30x500 gradient:'red-rgba(0,0,255,0.1)' -rotate 90 -alpha off show:

the lowest one is mostly red. That is correct behaviour!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug gradient with transparency IM 6.8.5.6 Q16 M

Post by fmw42 »

Thanks Anthony and Magick. I now have a better understanding of gradients with transparency. I have been able to create proper gradients now in my new script, multigradient, that can generate either linear or radial gradients with color stops.
Post Reply