How to minumize a image's size created by java.awt.BufferedImage?


M

MaoXuePeng

Hi, everyone:
I want to create a image conform 'PNG' format by
java.awt.image.BufferedImage class. So, which color type is best for
minumize the image's size and still with a proper quality??


I tried two color types. When used BufferedImage.TYPE_INT_RGB, the image
is too large! But There is nothing in the image except the black
background when used BufferedImage.TYPE_USHORT_555_RGB as the color type
in the constructor! What's Wrong???

Thanks.
MaoXuePeng.
 
Ad

Advertisements

A

Andrew Thompson

I want to create a image conform 'PNG' format

Why .png? (Rather than .jpg, for instance)
..by
java.awt.image.BufferedImage class. So, which color type is best for
minumize the image's size and still with a proper quality??

a 1x1 image with 1 color is smaller, but you really have
not described your images well enough to make further comment.

How big are they (WxH)? What original colur depth? Are they
images of the real world (plants, landscapes, people), or more
machines, structures, technical images.. or are they the more
'cartoon' style images with a limited number of colors?
I tried two color types. When used BufferedImage.TYPE_INT_RGB, the image
is too large!

How big is 'too large'?
..But There is nothing in the image except the black
background when used BufferedImage.TYPE_USHORT_555_RGB as the color type
in the constructor! What's Wrong???

More information required.

*Maybe* (note the maybe) an SSCCE can help answer most
of the questions above.
<http://www.physci.org/codes/sscce.jsp>
 

Top