> 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...

> >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.

There could be two reasons for performance problems.  First is the
overhead of creating a color transform, if this is being done for
every operation instead of being cached.  Second is possible per pixel
format conversions if the pixel data is not in a format accepted by the
color management engine.


> >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.

The Java2D implementations for Windows, Solaris, and Linux available
from Sun incorporate a color management engine from Kodak, distributed
as a native library as part of the JRE.  Licensees of the Java Platform
may choose to use other color management engines when porting to
specific platforms (e.g. I believe Apple intends to use ColorSync).


>  >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.

When JAI detects ColorSpaces based on ICC profiles, it uses the Java2D
ColorConvertOp class (java.awt.image.ColorConvertOp) to do color
conversions.  This class invokes native methods in the color management
engine.  ColorConvertOp currently supports only Perceptual intent.  The
only way in the Java2D API to get Relative Colorimetric intent is to call
the toCIEXYZ/fromCIEXYZ methods on ColorSpace, which requires a lot of
per pixel overhead.  We would be interested to hear any requirements
you have concerning rendering intents.


>  >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.

In JAI, each instance of ColorConvertOpImage will create a new Java2D
ColorConvertOp (when ICC-based ColorSpaces are involved).  There is no
internal caching of ColorConvertOp instances.  Also, the Java2D
implementation of ColorConvertOp does not share instances of transforms
across instances of ColorConvertOp.  However, if you're willing to
use ColorConvertOp directly, you can create a single instance based on
your input and output profiles and call the filter(Raster, WritableRaster)
method repeatedly, avoiding the creation of duplicate transforms.


>  >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?

As we distribute it in J2SE v1.3 and earlier releases, the color management
engine runs single threaded, so there is no benefit from dual processors.
We intend to fix this in a future release.

The other avenue to explore is whether your data format is optimal for
the ColorConvertOp Java and native code implementations.  In general,
8-bit and 16-bit unsigned integral samples should be fine.  Other
formats need some pre/post-processing and may be processed in a slow
per pixel loop.  If you can provide details of your image data, we
can determine if this is a problem.

The first thing I would suggest is to write a test program using the
Java2D ColorConvertOp class directly to see if this gives you reasonable
performance.

Jerry

===========================================================================
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