Login  Register

Re: use of alpha channel

Posted by dscho on Dec 16, 2008; 1:34pm
URL: http://imagej.273.s1.nabble.com/use-of-alpha-channel-tp3694244p3694245.html

Hi,

On Tue, 16 Dec 2008, Francesco.Decomite wrote:

> I would like to draw overlapping shapes, where the colors of both
> overlapping objects mix.
>
> I tried using the alpha channel one can define inside a awt.Color
> object.

ImageJ does not support the alpha channel, so you cannot do that using the
ImageJ API.

However, from how I read the code, I expect the createBufferedImage()
method of ColorProcessor to be able to create a BufferedImage that _does_
support painting with transparency.

Note:

- you will have to use BufferedImage's createGraphics() method to
  instantiate a Graphics2D object with which you can paint,

- you will need to call the updateAndDraw() method of ImagePlus, otherwise
  the visible image will not be updated.

- the result will _still_ not have an alpha channel, but be a plain RGB
  image.

Hth,
Dscho