[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Rendering images with an embedded colorspace Fabrizio Giudici Thu Feb 02 08:02:04 2012

On Mon, 16 Jan 2012 09:37:53 +0100, Harald Kuhr <[EMAIL PROTECTED]> wrote:

Hi Fabrizio,

Have you tried the drawImage method that takes a BufferedImageOp as a parameter, and pass it a ColorConvertOp, to do explicit color conversion?

Something like:

g.drawImage(image, new ColorConvertOp(yourCs, sRGB), 0, 0);

(or simply convert your image to sRGB using ColorConvertOp upfront and cache the result, if you have the time/memory to do so, for faster painting)

If that doesn't do it, it would be interesting to see some code. :-)

Well, but I don't want to convert it to sRGB. The image has got a larger gamut and I'd like to see it in the best possible way.

Is your BI TYPE_CUSTOM or any of the predefined types? What kind of CS are you using? An ICC profile based one, or a custom created (the latter is extremely slow converting using ColorConvertOp).

At the moment I'm trying test images with the AdobeRGB and ProPhotoRGB (free versions downloaded from http://sites.google.com/site/chromasoft/icmprofiles). I do expect lots of color burning when rendering (as Preview does) since my monitor has got a narrower gamut, it's the expected behaviour. The image is a TYPE_3BYTE_BGR, but I can change it to whatever is needed.

Perhaps I could use ColorConvertOp to the monitor current profile, but I supposed that Mac OS X, which is color managed from the ground up, did everything automatically (after all, what's RenderingHints.VALUE_COLOR_RENDER_QUALITY for?). That's why I'd be extremely disappointed if I find that the operation is slower than native code (I have some experience with color conversion in Java and actually it can be very slow, but it also depends on the type of the Raster). I'll try and let you know.

Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
http://tidalwave.it - http://fabriziogiudici.it
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]