Can you comment on the color conversion performance of  Java2D and methods
to speed up color conversion.  Does Java2D ever make use of platform color
conversion engines?  Please read thread below for more context...

Thanks,

Bruce Hodge
Miro, Inc.

[EMAIL PROTECTED]
650 494 7188

-----Original Message-----
From: Qinghuai Gao [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 22, 2001 10:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAI] Color conversion performance


Bruce:

 >I have questions about the performance and specific implementation of
 >color conversion.  I'm using ICC profiles to convert between Lab and
 >S-RGB.  It works fine except that the performance is not very good
 >compared to the other imaging operations that I'm currently using.  On
 >my 450Mz NT box, it's taking about 600 milliseconds to convert a 734K
 >image.
 >This seems pretty slow.  It also has similar performance under Win2000.
 >
 >Apparently the JDK has a Kodak color management engine (which JAI uses
 >in some cases?) , yet I've also read documentation that suggests that
 >the color management engine of the platform may also be used by JAI.

In your case, the source and destination color spaces are all ICC color
space.
If the data types are all integer, JAI uses the Java 2D color converting
operator. For the performance of this case, please contact
[EMAIL PROTECTED] They may give you a better answer than I do.
If
the data types are floating point, JAI does the conversion via CIEXYZ by
calling
the methods: toCIEXYZ and fromCIEXYZ of that color space. This may be slow.

 >
 >Typically color conversion operations also take a rendering intent (
 >e.g. Relative Colorimetric, Perceptual ) into account, which I see no
 >way to specify in the JAI API.  Also provisions are usually made to
 >cache the transform between 2 different profiles to improve the
 >performance of repeated color conversions.  No sign of this either,
 >unless it's done under the hood.
 >
 >What avenues can I explore to improve the performance of color
 >conversion?  Does JAI 1.3 have any improvements in this area?  Which
 >hardware/OS combinations are likely to give the best performance?  Is
 >there any support for dual processor configurations for Windows boxes?
 >

In JAI 1.1, we designed ColorSpaceJAI that subclassed from ColorSpace. The
JAI
1.1 color converting operator recognizes the subclass of ColorSpaceJAI.

If you want to improve the conversion performance, you may create you own
color
space, ColorSpaceLab, by subclassing ColorSpaceJAI. The following methods
need
to be overrided:

    public WritableRaster toRGB(Raster src,
                                         int[] srcComponentSize,
                                         WritableRaster dest,
                                         int[] destComponentSize);

    public WritableRaster fromRGB(Raster src,
                                           int[] srcComponentSize,
                                           WritableRaster dest,
                                           int[] destComponentSize);

After write your own color space,  to convert an image from s-RGB to Lab:
1. instantiate a ColorModel with a color space ColorSpaceLab;
2. use JAI color converting operator with this color model as a parameter;
3. the result image will be in ColorSpaceLab.

To convert it back,
1. instantiate a RGB color space;
2. use JAI color converting operator with this color model as a parameter
and
the result image above as the source;
3. the result image will be in s-RGB color space.

Hope this helps.

Qinghuai

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to