Your image is already 64x64 pixels. So why are your doing a -resize
to the same size?

Please clarify. This makes no sense to me.

Do you need to keep the transparency?

-flatten needs a background color, but then the transparency will go
away and become the background color in its place. But then your
white will not have any transparency. So this may not be what you
want as you lose transparency (and the file size still gets doubled)

I am still confused.

  From your histogram in identify -verbose wbtest.png, your background
is transparent black  rgb(0,0,0,0) or none and all other colors are
opaque rgb(x,y,z,1). so you have no pure white at rgb(255,255,255)
without having an opaque setting of 1. Whenever you have any
transparency all opaque colors get 1 for the alpha channel. So you
will have four channels, red, green, blue and alpha. This is true in
your original image. It is not white as rgb(255,255,255) but
rgb(255,255,255,1). To get rid of the alpha channel you have to turn
it off which will make the background black or flatten it to some
background color which can be white if you want

convert wbtest.png -background white -flatten -depth 8 wbtest_tmp2.pn


I leave off the -resize as it will not change the size of the image
as it is already 64x64, so resize only confuses things.

I also note that your input image has a compression of zip. The
output does also, but the compression amount may be different. You
can try -compress and see if that helps, but my experiments were
inconsistent.

For any processing, IM will read the image, decompress if compressed
and then process and recompress, possibly with a different amount OR
compression algorithm. This could explain the difference in file size.

At this point, I have not been able to preserve your original image
size. IM seems to approx double it even if I do

convert wbtest.png -depth 8 -quality 0 -compress zip wbtest_tmp6.png

Perhaps one of the IM folks can shed more light on the file size increase.


Fred


>Fred,
>
>What i want is basically having a 'no-operation' after i do a resize
>using the same original dimension.
>So, in the case of my image, the background is transparent and the
>size is 661 bytes and so i would like
>that to stay the same.
>
>When i do the operation:
>>   convert wbtest.png -resize 64x64 result.png
>
>i get a bigger image and i can see from doing a  'identify -verbose'
>that the  'Background' goes from 'white' to rgba(1,1,1,1).
>In most browser the resulting image display identically except in
>IE6 (of course!), and so that theoretically same resulting
>image is actually different.
>
>In terms of the size, i tried applying the argument '-flatten' and
>'-depth 8', but the resulting image is still much bigger:
>
>>   convert  wbtest.png  -flatten -depth 8 -resize 64x64 result.png
>>   ls -l wbtest.png result.png
>-rw-r--r--  1 stephane  staff  1498 Sep 22 20:18 result.png
>-rw-r--r--@ 1 stephane  staff   661 Sep 22 13:41 wbtest.png
>
>I attached the image.
>
>Thanks a lot for your help and recommendation. I am pretty ignorant
>in this field so maybe i a missing the obvious.
>
>S.
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to