I do not agree.

When I generate the image with an alpha channel, then it's another story. Photoshop thinks that it's a CMYK image while it's actually a ARGB. But when I force the codec to use only the 3 RGB bands with the setSourceBands command (see code bellow), then I get the weird behavior. The image displays correctly on most viewers but becomes very heavy. I can't tell what exactly goes wrong.

If you're interested I can send you on of those images for analysis.

Best

J�rg

Am 23.03.2004 um 19:40 schrieb Chris Campbell:

Hi J�rg,

This sounds a lot like 4836466, which we closed as "not a bug". See the report for more details:
http://developer.java.sun.com/developer/bugParade/bugs/4836466.html


Basically, it appears that many native apps have poor support for JPEG images with an alpha channel. If you can read back one of these images using IIO (ImageIO.read()) and everything displays properly, I'd say your issue is related to 4836466. If not, send me a small testcase containing your sample code (off the list) and I can take a look. Maybe there's a separate issue lurking out there...

Thanks,
Chris

On Mar 22, 2004, at 12:39 PM, J�rg Lehni wrote:
Thanks Jim!

That's how my latest code looks like, i simplified it a lot:

param.setSourceBands(new int[] {0, 1, 2});
param.setDestinationType(
ImageTypeSpecifier.createPacked(ColorSpace.getInstance(ColorSpace.CS_s RGB),
0x00ff0000,
0x0000ff00,
0x000000ff,
0x0,
DataBuffer.TYPE_INT,
false
)
);


But it still produces the same problems. The resulting jpeg files are strange, don't display correctly in some viewers and get much bigger in size than necessary.

If I use the workaround of copying the TYPE_INT_ARGB BufferedImage into a TYPE_INT_RGB BufferedImage and then generate the JPEG by just using the default settings, everything works fine.

It looks to me as if there is a bug in the JPEG codec.

What do you think?

J�rg

Am 17.03.2004 um 01:55 schrieb Jim Graham:

An image of TYPE_INT_ARGB uses a PackedColorModel with a Packed
Raster with a TYPE_INT DataBuffer.  It is incompatible with the
Byte-based ComponentColorModel (and SampleModel) that you are
creating.  I'm not sure how these two pieces of data would
interact in this case...

...jim

--On 03/15/04 22:40:12 +0100 J�rg Lehni wrote:
if (bi.getType() == BufferedImage.TYPE_INT_ARGB) {
// create a new ColorModel with OPAQUE transparency and no
alpha channel.
ColorModel cm = new
ComponentColorModel(bi.getColorModel().getColorSpace(), false, false,
Transparency.OPAQUE, DataBuffer.TYPE_BYTE);

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



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

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



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