fmw42 wrote:If there is a good reason to do it the way it is, then please clarify for me. Otherwise, it produces an non-logical result and certainly unexpected.
What you described is a mathematically line in 4D hypercube. where fully-transpareny colors are not all the same.
Here I generate a gradient off that type...
Code: Select all
convert -size 30x500 gradient:red-black gradient: -compose CopyOpacity -composite -rotate 90 gradient_old.png
Here I turn off alpha - you get your black-red gradient
Code: Select all
convert gradient_old.png -background white -alpha off gradient_old_alphaoff.png
Now lets do the equivelent of overlaying this gradient on white...
Code: Select all
convert gradient_old.png -background white -alpha remove gradient_old_overlay.png
Look carefully at the above gradient... It has this dark 'smudge' of dark colors in the middle. Now compare that to what you get if I had used a 'correct' transparent to red gradient and overaid it on white.
Code: Select all
convert -size 30x500 gradient:red-none -rotate 90 -background white -alpha remove gradient_new_overlay.png
Note how the gradient pure white to red, exactly as you would have gotten for a white-red gradient. A red to transparent gradient should NOT contain any black. it is transparent, not black!
Technically we could modify
gradient: so it knows about the 'alpha blending flag in the channel setting. In IMv6 that is done by simply using
-channel RGBA (turn off alpha blending 'sync' flag, in IMv6). however currently
gradient: does not do this.
NOTE the
-compose blend does understand turning off alpha blending in IMv6, but this is not used for individual pixel color blending such as what gradient is using.
Also I have not found out from Cristy yet as to how to turn off alpha blending in IMv7, though internally in the core library it is present as a 'alpha channel trait'. It is set up in a different way so as to allow the use of multiple (and separately switch-able) alpha channels.