Re: Making color image with transparency into black & white w/transparency



Solution found, with help from Knute:

BufferedImage bufferedImage = new BufferedImage(usableWidth,
usableHeight, BufferedImage.TYPE_4BYTE_ABGR_PRE);
bufferedImage.createGraphics().drawImage(img, 0, 0, usableWidth,
usableHeight, this);

ColorSpace grayColorSpace =
ColorSpace.getInstance(ColorSpace.CS_GRAY);
ColorConvertOp op = new ColorConvertOp(grayColorSpace,
bufferedImage.getColorModel().getColorSpace(), null);
op.filter(bufferedImage, bufferedImage);

g.drawImage(bufferedImage, MARGIN, MARGIN, usableWidth, usableHeight,
this);

Greg

.