[PLUG] Strange Image Magick issue

Mark Martin mmartin at u.washington.edu
Thu Aug 21 16:56:01 UTC 2003


On Thursday 21 August 2003 15:14, Matt Alexander wrote:
> I'm trying to make an image 50% of it's original size and convert it from
> TIFF to PNG.
>
> When I use convert without any options, I get the following:
> convert image.tiff image.png
>
> 117K image.tiff
> 206K image.png
>
> I'm not sure why PNG is so much larger, but whatever...
> Here's the odd part:
>
> convert -resize 50% image.tiff image-50.png
>
> 654K image-50.png
>
> The image looks 50% smaller when I open it, but why did the file size
> balloon?  And what do I need to do to make it a smaller file size?
> Thanks,
> ~M

Matt,

I'm not sure about the issues with file sizes in relation to converting from 
tiff to png.  However, I use ImageMagick to create smaller versions of the 
images that I take off of my digital camera.  I can't tell you what the 
"resize" option does since I haven't used it (from the command line anyway) 
but I can tell you that the "geometry" option should do what you're wanting, 
without causing the file sizes to balloon.  To create a file that is 50% 
smaller in both dimensions, use a command like

convert -geometry 50%x50% image.png image-50.png

or

convert -geometry 50%x50% image.tiff image-50.png

if you're wanting to skip the intermediate step.

As Paul pointed out in another response, you can control the file sizes to 
some extent using the "quality" option, which only pertains to jpeg, miff, 
and png files.  The valid ranges for the compression levels are 0-100 for 
jpeg and png and 0-9 for miff.  See the man pages for convert and ImageMagick 
for more information.

Enjoy!

Mark
-- 
---------------------------------------------------------------------
Mark A. Martin, Ph.D.
Applied Mathematics -- Software Development -- Systems Administration
Currently available for employment.
See http://www.amath.washington.edu/~mmartin/resume/ for details.
---------------------------------------------------------------------





More information about the PLUG mailing list