When I use this code to scale bufferedImages of TYPE_USHORT_GRAY or TYPE_BYTE_GRAY, the image returned is brighter than the one passed to the method?
Does anyone have any idea of what I am doing wrong here?
Thanx in advance.
public BufferedImage scale_ (BufferedImage img, double magFactor)
{
int imgWidth = (int) (img.getWidth()* magFactor);
int imgheight = (int) (img.getHeight() * magFactor);
displayImage = new BufferedImage ( imgWidth, imgheight, img.getType() );
Graphics2D g = (Graphics2D) displayImage.getGraphics();
g.drawImage( img, 0, 0, imgWidth, imgheight, null);
return displayImage;
}