Page 1 of 1

result png file size after montage compared to gimp

Posted: 2007-11-29T11:27:27-07:00
by dafi
I use montage to produce one finale png with four images.
All works fine but the final file size is ever bigger that the same saved with gimp.

How can I have size more similar to gimp?

Actually my images are RGB with Alpha channel, the command line I use is shown below:

Code: Select all

montage -strip -quality 100 \
        -background none \
         -geometry +0+0 \
         image_1.png image_2.png image_3.png image_4.png \
         result.png

Re: result png file size after montage compared to gimp

Posted: 2007-12-02T22:32:43-07:00
by anthony
PNG will store images with a lot of detail. So of course the result is bigger.

You can try using a different -quality setting for PNG (see IM examples PNG, quaility)
or better still try using "OptiPNG" to compress you image better.

If exact color and no transparency is involve you can try saving to PNG8:image.png to get a color reduced version. Or you can use another PNG tool "pngnq" to do the same thing in a non-IM way, but attempts to preserve semi-transparency (which the IM PNG8 coder can not do.

Re: result png file size after montage compared to gimp

Posted: 2007-12-03T11:50:02-07:00
by dafi
Thank you for your hints, OptiPNG produces file size smaller than ImageMagicK and very closer to GIMP.

I love ImageMagicK and appreciate very much if it can have same OptionPNG capabilities.

Re: result png file size after montage compared to gimp

Posted: 2007-12-03T20:04:09-07:00
by anthony
That would be nice. and you can actually set up a 'optpng:' output delegate to get IM to call that program itself. (That would actually be a nice delegate example too if someone would care to figure it out.)

however the coders within IM are limited by the fact that IM is itself a general image processor. while optipng is a specialized processor so can spend more time and effort on just one part.

Re: result png file size after montage compared to gimp

Posted: 2007-12-03T20:24:26-07:00
by magick
Try this:
  • convert logo: logo.pnm
    convert logo.pnm png8:logo.png
    ls -l logo.png
    -rw------- 1 cristy cristy 36917 2007-12-03 22:19 logo.png
    optipng -o7 logo.pnm
    ls -l logo.png
    -rw------- 1 cristy cristy 35384 2007-12-03 22:22 logo.png
The resulting images are fairly close in size.

Re: result png file size after montage compared to gimp

Posted: 2007-12-04T10:01:23-07:00
by dafi
magick wrote: optipng -o7 logo.pnm
ls -l logo.png
-rw------- 1 cristy cristy 35384 2007-12-03 22:22 logo.png[/list]

The resulting images are fairly close in size.
This is what I want, my images after "-o7" cure are 38% smaller :D

Thank you