possible documentation typo regarding color none

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

possible documentation typo regarding color none

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible documentation typo regarding color none

Post 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.
wortell

Re: possible documentation typo regarding color none

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

Re: possible documentation typo regarding color none

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible documentation typo regarding color none

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply