Strange result: layer offset and filesize

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
poison

Strange result: layer offset and filesize

Post by poison »

Hi ^^
First I wanted to apologize for using such large files, but I wanted to demonstrate the issue with the filesize.
I have a small script that basically does the following:
convert "src.jpg" -trim "tmp.png"
convert "tmp.png" -resize '768x768>' -strip "src.png"

Whenever I use this script to crop&convert&resize images I get a really strange result when opening the file in Gimp:
Image
Theres always this Layer offset. Here's the file this screenshot is from: http://217.28.99.42/DPKLAKT20080004.png

The second problem is that the resulting file is always extremely large, for this source file: http://217.28.99.42/DPKLAKT20080004.jpg
its ~1.5MB in size.
When opening it with Gimp and doing:
Image -> Fit Canvas to Layers and saving it the file has only ~390KB: http://217.28.99.42/DPKLAKT20080004_.png

Is there anything I'm doing wrong?
I'm using imagemagick-6.3.7_4 and gimp-2.4.2 on slackware-current.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Strange result: layer offset and filesize

Post by magick »

Add +repage to your command line to remove the page offset.
poison

Re: Strange result: layer offset and filesize

Post by poison »

Thank you, that works.
But what about the filesize (1.5MB vs 390KB)?
With -quality 0 its 1.5MB and with -quality 100 its 1.6MB, ~4 times the size compared to saving with Gimp.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Strange result: layer offset and filesize

Post by magick »

Add -depth 8 to your command-line to reduce the image size.
Post Reply