large byte size for charts

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

large byte size for charts

Post by Marcus Bjorke » Fri Sep 27, 2002 2:03 pm

Hi. Does anybody know how to compress images produced by JFreeChart?

From my point of view the graphs produced by JFreeChart are very large. Is there any way to compress them more. I am using png and the image is about 28 kb. I can easily reduce that size with any image-editor down to about 10 kb without loosing visible quality.

Thanks,
Marcus

David Gilbert

Re: large byte size for charts

Post by David Gilbert » Fri Sep 27, 2002 3:20 pm

Hi Marcus,

I use a free (GNU LGPL) class called PngEncoder to encode the PNG files. It was written by J. David Eisenberg.

I notice in that class there is a constructor that allows you to specify the compression level:

public PngEncoder( Image image, boolean encodeAlpha, int whichFilter,
int compLevel)

The default seems to be zero, you could try altering that to see what effect it has.

Regards,

DG.

Locked