Proper JAI Practices

Hello All,

I have an imaging program that uses JAI extensivly and I was wondering if there are any "proper" coding techniques when using JAI that handle memory management, running time etc...

For example.

I am loading, adjusting brigheness, contrast, adding border, and saving an image. How I am doing this currently is I have a static class that has methods such as jaiLoad, jaiBrightness, jaiContrast, jaiBorder etc. and I am just running them 1 after another.

The problem comes when I start to perform many operations, I start to get out of memory errors, long execution time etc.

Is there a way to combine multiple JAI operations into 1 parameter block?
Is there any way to minimize the amount of memory a RenderedOp takes up?
Should I be using BufferedImage's or RenderedOp's?

I have searched and searched the web for good JAI resources but there seems to be none. I think when I figure out all of this I might dedicate a website to JAI.

Resources, tips, code snipplets would all help!



P.S. Please no suggestions about setting the JVM memory (eg. -Xmx, -Xms)
Who is Participating?
fffej78Connect With a Mentor Commented:
The resources on are good see

There is a book, but I have no idea how good it is "Building Imaging Applications with Java(TM) Technology: Using AWT Imaging, Java 2D(TM), and Java(TM) Advanced Imaging (JAI)"
The FAQ is here ( )

Looking at samples is the best way to do things "properly".

Best place to ask for help is the mailing list on JAI itself:

Image processing does take a lot of time and memory in general though :)
hoomanvConnect With a Mentor Commented:
maclemaAuthor Commented:
I am going to leave this question open for a while longer in hope of more resources...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.