|
From: Ethan A M. <sf...@us...> - 2016-07-07 18:45:17
|
On Thursday, 07 July, 2016 12:01:27 Daniel J Sebald wrote:
> I'm working on something with alpha channel and noticed that the alpha
> channel 0 to 1 range behaves differently for color specification and for
> input data. For color spec (help colorspec):
>
> "#AARRGGBB" represents an RGB color with an alpha channel (transparency)
> value in the high bits. An alpha value of 0 represents a fully opaque
> color;
> i.e., "#00RRGGBB" is the same as "#RRGGBB".
>
> and for rgbalpha (help alpha):
>
> The `rgbalpha` plotting style assumes that each pixel of input data
> contains
> an alpha value in the range [0:255]. A pixel with alpha = 0 is purely
> transparent and does not alter the underlying contents of the plot. A
> pixel
> with alpha = 255 is purely opaque.
>
> Was there a reason for the opposite correlation of the opacity/transparency?
Removing the inconsistency between line colors and image pixel colors
was on the list of possible major changes in gnuplot version 5.
There was a bit of discussion at the time, but no one argued strongly
enough for unification to outweigh the clear disadvantages:
- breaking backward compatibility
- inherent conflict of obvious defaults:
line color #00RRGGBB "obviously" should be the same as #RRGGBB
but
image processing has historically used alpha=0 as fully transparent
This same inconsistency of whether "0" is fully transparent or fully
opaque is present in real-world image formats and in other program
implementations.
Ethan
|