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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top