Page 1 of 1

png files convert on linux

Posted: 2009-03-17T18:33:50-07:00
by skyisthelimit
i have a png file (1023X1448) ,it's 58.3 kb. when i did the operation below on windows, its size became 54.9kb, but on linux,after the same operation,i got a 157kb file.where is the problem?

Rectangle rect = new Rectangle(110, 150, 810, 1220);
ImageInfo info = new ImageInfo(filepath);
info.setDepth(2);
info.setQuality(100);
MagickImage image = new MagickImage(info);
MagickImage image1 = image.cropImage(rect);
image1.setFileName(name);
image1.scaleImage(640, 1220*640/810).writeImage(info);

thanks in advance!

Re: png files convert on linux

Posted: 2009-03-17T19:00:16-07:00
by magick
Try setting the image compression before you write the image. PDF supports a number of compression algorithms such as Zip and JPEG.

Re: png files convert on linux

Posted: 2009-03-17T19:49:16-07:00
by skyisthelimit
i set both ZipCompression.it took no effect.
i am sure the scale operation brings the differences. i view them with photoshop ,the two image are different obviously.
how can i do?