[REBOL] Re: Alpha channel of image! type
From: aete:ramdamfilms at: 14-Nov-2002 17:52
Hmmm. That's not what I get at all. The following example session shows that
each pixels is, in fact, stored in 32 bits (test.png does have an alpha
channel):
>> img: load %test.png
>> == make image! [89x133 #{
466DB1476EB24970B44B72B64C73B64C73B74B72B64B72B64970B44A71B5
4B72B64B72B54970B44970B34A71B44B72B64D71BD4C...
>> first img
== 177.109.70
>> second img
== 109.70.0
>> third img
== 70.0.178
You can see that, using first, second and third, I can scroll through the
image's data one byte at a time, and that the fourth element is the fourth
byte of the pixel. So far so good. But then things start to get weird.
First, the value should be 255, as the alpha channel is white in the image,
and second, I don't have access to the fourth component of the pixel:
>> img/1
== 177.109.70
>> img/1/4
== none
I verified this behaviour on both MacOS and Linux implementations of
REBOL/View (versions 1.2.1.2.1 and 1.2.1.4.2 respectively) Could this be a
platform issue?
And, by the way, thanks for all the help! You all gave me cool hints on how
I can solve my problem in a more "rebol-like" way!
-C