png files convert on linux

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
skyisthelimit

png files convert on linux

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: png files convert on linux

Post by magick »

Try setting the image compression before you write the image. PDF supports a number of compression algorithms such as Zip and JPEG.
skyisthelimit

Re: png files convert on linux

Post 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?
Post Reply