As I suspected - this is boiling down to the fact that we don't have specific loops to handle the type of image you are working with so our "generalized backup loops" are being called on to do the work, albeit at a slower pace.

The image you got from ImageIO appears to be a 1-bit binary image - I assume your input data was just a bi-level, possibly black/white, image? We don't have a lot of loops to handle those images so internally they need to be converted to other formats for handling. Also, the code appears to go through our other image scaling path which uses an AffineTransformOp to scale it rather than the more direct TransformHelper route that the other images are using.

The good news is that ImageIO is using an image format that takes 8 times less storage to store your source image. The bad news is that it takes longer to scale.

The workaround would be for you to manually copy the image into a new BufferedImage of a relatively safe known type - I'd recommend TYPE_INT_ARGB for this even thought your image doesn't appear to have alpha because a little birdy just told me that the only conversion loop we have that is specific to 1-bit images is the one that converts to that format.

You should also submit a bug on java.sun.com about the poor performance of scaling 1-bit images - we should probably beef up the loops we have for that type of image, especially since it seems to be a preferred output format for at least one type of image format that ImageIO supports...

                        ...jim

[EMAIL PROTECTED] wrote:
Here it is

Source image info: [EMAIL PROTECTED]: type = 12 IndexColorModel: #pixelBits = 1 
numComponents = 3 color space = [EMAIL PROTECTED] transparency = 1 transIndex   
= -1 has alpha = false isAlphaPre = false BytePackedRaster: width = 2480 height 
= 3504 #channels 1 xOff = 0 yOff = 0
sun.java2d.loops.Blit$GeneralMaskBlit::Blit(ByteBinary1Bit, SrcNoEa, IntArgbPre)
sun.java2d.loops.MaskBlit$General::MaskBlit(ByteBinary1Bit, SrcNoEa, IntArgbPre)
sun.java2d.loops.Blit::Blit(ByteBinary1Bit, SrcNoEa, IntArgb)
sun.java2d.loops.MaskBlit::MaskBlit(IntArgb, AnyAlpha, IntArgbPre)
sun.java2d.loops.Blit$GeneralMaskBlit::Blit(IntArgbPre, SrcOverNoEa, IntRgb)
sun.java2d.loops.MaskBlit$General::MaskBlit(IntArgbPre, SrcOverNoEa, IntRgb)
sun.java2d.loops.Blit::Blit(IntArgbPre, SrcNoEa, IntArgb)
sun.java2d.loops.MaskBlit::MaskBlit(IntArgb, SrcOver, IntRgb)
sun.java2d.loops.Blit$GeneralMaskBlit::Blit(IntArgb, SrcOverNoEa, IntRgb)
sun.java2d.loops.MaskBlit::MaskBlit(IntArgb, SrcOver, IntRgb)
sun.java2d.loops.Blit$GeneralMaskBlit::Blit(IntArgb, SrcOverNoEa, IntRgb)
sun.java2d.loops.MaskBlit::MaskBlit(IntArgb, SrcOver, IntRgb)
Run time: getScaledInstance() : 1641 ms



I hope this is what you want.
[Message sent by forum member 'rahjman' (rahjman)]

http://forums.java.net/jive/thread.jspa?messageID=300105

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