ing. P.W.L. JANSSEN wrote:
>
> Hi everybody,
>
> I know this isn't the right place to ask my question, but it has a lot to do with the
> discussed subject.

[snip]

> I want to make an image with the "default JDK" createImage() function of 2400x2600
> pls. With 4bpp it makes the picture nearly 25Mb. Is there any way to create the image
> with less bytes per pixel. And is it true that this image is also kept four times in
> memory, so the heap must be at least 100 Mb!! ?

Yes, exactly. If you flush() the image, it drops it down to half the
memory usage, but as soon as you access any of the pixels in the image,
it jumps back up again (exactly what the J3D texture mapping does).

This has been a very major bitch of mine, and many others, for a long
time now - way, way back to JDK 1.1 FCS days. There has been major rage
sessions by us developers over on the advanced-java list for many moons
and Sun still point blank refused to acknowledge that there was even a
problem. It wasn't until I faced them down at a JavaOne BOF (Java 2D)
this year, that we got any acknowledgement but they are still refusing
to do anything about it.

I could go into a long whiny technical detailed explanation as to what
is going on, but I won't. Instead, I will point you to my image loading
libraries at:

http://www.vlc.com.au/~justin/java/imageloader/images/

where there is a LGPL'd set of content handlers that can replace the
standard Java libraries. These libraries are twice as fast and use a
quarter of the memory of what Sun provide. Supported formats are:

TIFF (with some bugs due to LZW compression)
PNG
JPEG
BMP
XPM,PPM etc etc

GIF is also supported, but only as a wrapper around the standard Sun
provided junk. I don't have an LZW patent license.

Read, the readme, because the current version has a minor/major bug
(depending on how you look at it) with the JNI interface. Need to
purchase a copy of VC++ just to fix it - yuck.

These libs act as standard content handlers, so all you need to do is
create a java.net.URL to point at the image and then call getContent().
You will be returned a BufferedImage instance (or, if you recompile for
JDK 1.1, a normal Image). If you don't know how to use content handlers,
then have I got a book for you :P. Send me private email, or wait a week
or so for an article to appear over at JDC that I'm currently writing.


--
Justin Couch                                   Author, Java Hacker
Snr Software Engineer                     [EMAIL PROTECTED]
ADI Ltd, Systems Group              http://www.vlc.com.au/~justin/
Java3D FAQ:       http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
 Turn it or move it, and a new set of arrangements appears... is it
 a single light or many lights, lights that one must know how to
 distinguish, recognise and appreciate? Is it one light with many
 frames or one frame for many lights?"      -Subcomandante Marcos
-------------------------------------------------------------------

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

Reply via email to