Proper JAI Practices

Posted on 2006-05-26
Last Modified: 2008-01-09
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)
Question by:maclema
    LVL 4

    Accepted Solution

    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 :)
    LVL 14

    Assisted Solution

    LVL 5

    Author Comment

    LVL 5

    Author Comment

    I am going to leave this question open for a while longer in hope of more resources...

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    This video teaches viewers about errors in exception handling.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now