How to reduce the size of the images?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Navin Pathuru

How to reduce the size of the images?

Post by Navin Pathuru » Tue Oct 08, 2002 4:47 pm

Hello David

Great work. There is a lot to learn from you. I was wondering if there is a way that we can reduce the size of the images. When you save the image they are like 23 KB, etc. All of them are in 20Kbs and above 15 Kbs. Can you give any pointers if know.

Regards,
Navin Pathuru

David Gilbert

Re: How to reduce the size of the images?

Post by David Gilbert » Tue Oct 08, 2002 4:54 pm

Hi Navin,

There are parameters you can use with the PNG encoder (I think the tradeoff here is compression versus speed) and also with the JPEG encoder (here the tradeoff will be compression versus quality). These parameters are not exposed via the JFreeChart API yet (in the ChartUtilities class), but I am having a look at it.

Regards,

DG.

Navin Pathuru

Re: How to reduce the size of the images?

Post by Navin Pathuru » Tue Oct 08, 2002 4:56 pm

Great.

Thanks David.
Navin.

Stefan Lindroos

Re: How to reduce the size of the images?

Post by Stefan Lindroos » Tue Nov 05, 2002 1:57 pm

In the ChartUtilities-class you already use:

private static final int DEFAULT_PNG_COMPRESSION = 9;

which is the maximum compression level in this case.

Have you evaluated other png-encoders.

Regards,
Stefan

Locked