Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
can you get the RenderedImage first using readAsRenderedImage(), get the ColorModel/ColorSpace from there just 1 time, then do the rest of your tiling from that point? ummm yes, could do that... That would work ok. But it would be a good thing to know how to find out what the color

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread Nidel, Mike
- From: Discussion list for Java 2D API [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, June 17, 2008 4:07 PM To: [EMAIL PROTECTED] Subject: Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi can you get the RenderedImage first using

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
The Raster has bytes that represent the colors of the pixels. But the bytes are not in the RGB or sRGB space. They have to be converted from whatever they are to the RGB space. So how do you do that if you don't know what colorspace the Raster bytes are in? Do you shift left; right; up;

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
It seems to me that getRawImageType was supposed to give the raw colorspace (say YCbCr) for the src but for some reason it couldn't so it gave an RGB colorspace, which makes it unreliable. The following javadoc seems to be somewhat confusing:

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
It seems to me that getRawImageType was supposed to give the raw colorspace (say YCbCr) for the src but for some reason it couldn't so it gave an RGB colorspace, which makes it unreliable. The following javadoc seems to be somewhat confusing:

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
The root of the problem is that readRaster(int, ImageReadParam) ignores the ImageTypeSpecifier's color and/or destination in the ImageReadParam. I don't agree with you here. The javadoc of this method clearly says that it returns raw pixel data without color conversion applied, and it ignores

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
The root of the problem is that readRaster(int, ImageReadParam) ignores the ImageTypeSpecifier's color and/or destination in the ImageReadParam. I don't agree with you here. The javadoc of this method clearly says that it returns raw pixel data without color conversion applied, and

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
All we know for sure is that the only way to get the Raster is to make a BufferedImage using read(0) which guarantees a performance hit. I am not that sure. You seem to be asking for something more than the Raster. :-) As Robert suggested at

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
All we know for sure is that the only way to get the Raster is to make a BufferedImage using read(0) which guarantees a performance hit. I am not that sure. You seem to be asking for something more than the Raster. :-) As Robert suggested at

Re: [JAVA2D] javax.imageio.ImageReader.readRaster(..) returns raster wi

2008-06-17 Thread java2d
I don't have a simple example, but the following pages might be helpful: http://java.sun.com/javase/6/docs/technotes/guides/imageio/spec/apps.fm5.html http://java.sun.com/javase/6/docs/api/javax/imageio/metadata/doc-files/jpeg_metadata.html [Message sent by forum member 'jxc' (jxc)]