Hi,
I get a loss of colour when encoding a JPEG from the BufferedImage retrieved from the createBufferedImage method on the JFreeChart class.
I am using the standard sun 'com.sun.image.codec.jpeg.JPEGCodec' and
'com.sun.image.codec.jpeg.JPEGImageEncoder' classes.
For example. If I get set a series paint to RBG(255,0,0). I'd expect this colour on the JPEG, however, the colour of the series is more like a paler red (200, 10, 10).
Documentation about the BufferedImage indicates when you create a BufferedImage you set what type of colour table it should use. However, I don't seem to be able to tell JFreeChart to use a different BufferedImage colour table type before called 'createdBufferedImage'. Has anybody had any other similar colour problems? And how did you resolve them?
Many thanks
Simon
Loss of colour when rendering JPEG
Re: Loss of colour when rendering JPEG
Hi Simon,
I'm not shure if i understood your problem. But maybe this can help you out: you can create your own BufferedImage, then create a graphics2D object and use the JFreeChart.draw(Graphics2D, Rectange2D) method.
Then you can configure the color-settings of your image at free will (while you create the image).
Hope that helps you,
Regards,
Andreas Schroeder
I'm not shure if i understood your problem. But maybe this can help you out: you can create your own BufferedImage, then create a graphics2D object and use the JFreeChart.draw(Graphics2D, Rectange2D) method.
Then you can configure the color-settings of your image at free will (while you create the image).
Hope that helps you,
Regards,
Andreas Schroeder