I tried this myself and I couldn't get the file sizes that you were getting.
Here's a list of the commands I was running:

wget http://joel.poloney.com/source.png
convert -resize 426x320 -dither -colors 256 -depth 8 source.png resized.png
pngcrush source.png crushed.png

Here are my file sizes:

crushed.png - 76,593
resized.png - 142,057
source.png - 87,833

Any ideas?

-- Joel


On Fri, Apr 25, 2008 at 9:30 AM, Ross Presser <[EMAIL PROTECTED]> wrote:

> 1. Your source image is a 256-color palette image.  If you resize any
> image, by default the output will be in truecolor aka 24 bit color aka 8
> bits per pixel.  You must quantize the image down to 256 colors. This
> commandline resizes and quantizes, giving an output of 52,209 bytes:
>
>   convert -resize 426x320 -dither -colors 256 -depth 8 source.png
> resized.png
>
> 2. For even more compression, you can turn to pngcrush, not part of
> imagemgick but a separate package. pngcrush applied to resize.png gave me an
> output of 49,905 bytes.
>
> 3. Both convert and pngcrush will preserve the transparency in this case.
>
>
> On Fri, Apr 25, 2008 at 3:31 AM, Joel Poloney <[EMAIL PROTECTED]> wrote:
>
>> I've been banging my head against this all night and can't come up with
>> any
>> solution. I'm trying to take a PNG image, resize it, and compress it (if I
>> can). The PNG image I'm working with has transparency. You can find it
>> here:
>> http://joel.poloney.com/source.png. I have imagemagick version 6.2.4.
>>
>> The source png is 85kb. If I run the command "convert -compress JPEG
>> -quality 80 source.png output.png", the output.png is about 118kb.
>> Obviously, that didn't work. Say I want to resize this image down before I
>> compress it. The original size of this is 600x450. If I run the command
>> "convert -resize 426x320 source.png resized.png", the resized.png is about
>> 150kb. Why is my image smaller pixel-wise and bigger file-size wise?
>>
>> I then began experimenting with image masks. I figured, if I could extract
>> out the alpha channel into a 8-bit mask.png ("convert source.png -channel
>> matte -negate -separate -depth 8 -type Grayscale mask.png"). I then
>> converted the png to a jpeg and compressed the jpeg. I finally composed
>> the
>> two back together with the "-compose Copy_Opacity" option, and it works...
>> but the file size is enormous.
>>
>> If I use the original source png in Flash CS3 and create a simple movie
>> with
>> 1 frame (the source.png), and export it (with a jpeg compression of 80),
>> the
>> resulting swf is 37.1kb. They're doing some kind of compression and I
>> can't
>> figure out what it is and why it's not working with imagemagick.
>>
>> Any suggestions?
>>
>> Thanks,
>>
>> -- Joel
>> _______________________________________________
>> Magick-users mailing list
>> [email protected]
>> http://studio.imagemagick.org/mailman/listinfo/magick-users
>>
>
> Greased Lightbox <http://shiftingpixel.com/lightbox/> →←+-↻
>
> Loading image
>
> Click anywhere to cancel
>
> Image unavailable
>
>
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to