Skip to main content

Alpha Band of RGB image

3 replies [Last post]
justin_warren
Offline
Joined: 2006-10-23
Points: 0

Just a quick question.. Is the alpha band of an RGBa image always the 4th band, or is it possible to be either the 1st or 4th band? If the second option, how can I tell which band it is?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Nidel, Mike

I'm going to take a stab at this. The alpha channel is always LOGICALLY
the 4th band, assuming the color model says the image has alpha.

However, the alpha channel may be (and often is) first. The way to see
this is to check the SampleModel's band offsets. I think that accessor
is only available on a ComponentSampleModel. If the image is RGBA the
offsets will look like [0 1 2 3] and if it is ARGB (a common layout)
then
the offsets will be [3 0 1 2] and so forth.

I think.

> -----Original Message-----
> From: jai-interest@javadesktop.org
> [mailto:jai-interest@javadesktop.org]
> Sent: Wednesday, February 07, 2007 8:56 AM
> To: interest@jai.dev.java.net
> Subject: [JAI] Alpha Band of RGB image
>
> Just a quick question.. Is the alpha band of an RGBa image
> always the 4th band, or is it possible to be either the 1st
> or 4th band? If the second option, how can I tell which band it is?
>
>
> Thanks
> [Message sent by forum member 'justin_warren' (justin_warren)]
>
> http://forums.java.net/jive/thread.jspa?messageID=202431
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

Right on!

On Wed, 7 Feb 2007, Nidel, Mike wrote:

> I'm going to take a stab at this. The alpha channel is always LOGICALLY
> the 4th band, assuming the color model says the image has alpha.
>
> However, the alpha channel may be (and often is) first. The way to see
> this is to check the SampleModel's band offsets. I think that accessor
> is only available on a ComponentSampleModel. If the image is RGBA the
> offsets will look like [0 1 2 3] and if it is ARGB (a common layout)
> then
> the offsets will be [3 0 1 2] and so forth.
>
> I think.
>
>> -----Original Message-----
>> From: jai-interest@javadesktop.org
>> [mailto:jai-interest@javadesktop.org]
>> Sent: Wednesday, February 07, 2007 8:56 AM
>> To: interest@jai.dev.java.net
>> Subject: [JAI] Alpha Band of RGB image
>>
>> Just a quick question.. Is the alpha band of an RGBa image
>> always the 4th band, or is it possible to be either the 1st
>> or 4th band? If the second option, how can I tell which band it is?
>>
>>
>> Thanks
>> [Message sent by forum member 'justin_warren' (justin_warren)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=202431
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
>> For additional commands, e-mail: interest-help@jai.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

justin_warren
Offline
Joined: 2006-10-23
Points: 0

thanks Mike.. worked like a charm!