Page 1 of 1

possible documentation typo regarding color none

Posted: 2008-04-15T12:32:29-07:00
by fmw42
In reviewing your page:
http://imagemagick.org/script/color.php

It says near the middle:

"There is also a 'none' color that is fully transparent. This color is shorthand for rgba(0, 0, 0, 0.0)."

But at the bottom of the color chart and page it shows none and transparent as:

none rgba( 0, 0, 0, 1.0) #00000000
transparent rgba( 0, 0, 0, 1.0) #00000000

Which is correct rgba(0,0,0,0) or rgba(0,0,0,1)? I suspect the former! A correction seems in order somewhere.

Also, I have recently seen a post that said one could do colorname-none to get a transparent color, e.g. red-none? For example to make a transparent gradient:

convert -size 100x100 gradient:red-none redgrad.png

If this hyphenated syntax is valid, could you put a comment about this on this page?

Re: possible documentation typo regarding color none

Posted: 2008-04-15T13:06:44-07:00
by magick
Fixed the none/transparent color definitions. Allow for 24 hours for the fix to mirror world-wide.

A range of colors (e.g. red-none) is only valid for a gradient and is documented on the formats web page where the gradient format is described.

Re: possible documentation typo regarding color none

Posted: 2008-05-30T09:37:53-07:00
by wortell
Thanks... and I'm glad that this is fixed... but my challenge is in creating a "TRUE" color to transparent image that DOESN'T look gray/dirty....

Code: Select all

convert -size 256x256 -background none gradient:'none-red' gradient.png
That yields a 100% transparent top-line and then progressively becomes opaque red :).
This is all good and fine, and I use this on many of my routines, but noticing the grayness to the image...
in fact, if you're in doubt - take any 'eye-dropping tool' and put it over that image in the semi-transparent areas near the top (gray-like) areas :).

It'll come up SURE ENOUGH - GRAY! (or a shade of...)

How do i get it so that it's TRULY LESS gray... (maybe i'm just expressing my ignorance here... in asking this (probably mute point) question. :)

And to top it all off... if I was to place this over a 100% perfectly RED Rectangle of equal size I get a darker interior of the square ... goes from a 100% red --> slightly darker red --> 100% red again...

Uh.... how can I make that DARNED red->none gradient more pure!?!?!?

is it possible?

Re: possible documentation typo regarding color none

Posted: 2008-05-31T08:19:29-07:00
by fmw42
I have looked at your example and you are right. The issue seems to be that the gradient:red-none is not just making a gradient of the alpha channel (as I think it should in this case), but is making a gradient:red-black under the alpha gradient whereas it should be solid red under the alpha.

You can see this by removing the alpha channel on the gradient:

convert -size 100x100 gradient:red-none grad_red_none.png
convert grad_red_none.png +matte grad_red_none_nomatte.png


Here is one way to generate the red-none gradient that does work the way you want:

convert \( -size 100x100 xc:red \) \( -size 100x100 gradient: \) +matte -compose copy_opacity -composite true_grad_red_none.png

Re: possible documentation typo regarding color none

Posted: 2008-06-29T03:39:46-07:00
by anthony
The quickest and simplest way to generate a true -- nondirty looking gradient with transparency is to generate a black-none gradent, and color it...

Code: Select all

    convert -size 100x100 gradient:none-black \
          -fill red -colorize 100%   gradient_pure_trans.png
This was added to IM examples recently, but I don't think it has made it into the offical site yet. When it does appear (give it a day or so) this will be talked about in... Gradients with Transparency