> ...I need to take an RGB w/alpha image and create a Black and White mask
> corresponding to the alpha and non-alpha pixels.
>
> For this case, lets say any pixel with alpha == 0.0f is black and
> 0.0f < alpha <= 1.0f.

Do you mean that 0.0f < alpha <= 1.0f is white?

If so, one way to do it would be to get a subraster from the RGBA image
which is just the alpha channel.  Then create a BufferedImage using this
raster and an IndexedColorModel that maps 0 to black and everything else
to white.  Then draw this BufferedImage to a new BufferedImage of
TYPE_BYTE_BINARY or TYPE_BYTE_GRAY to create a 1-bit or 8-bit mask image.

Jerry

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to