How to reduce png file size
Posted: 2012-10-21T04:49:58-07:00
Hi,
I have a convert command that produces a png file which is too big for my purposes. I get files with more than 200 kb but it should be less than 50 kb, if this is possible. How do I have to modify the parameters? What can I do? The quality of the image should be as close as possible to the original file. Note: the in.png could be also an in.jpg (or other supported formats). All works fine so far. Just the file is too big.
What the command does: From the source image it creates an ruond image that will have a certain width and heigth, surrounded by a round border. It could be that this is not perfect, but it currently does what it is ougth to do. Must it be different in order to reduce the file size?
Hope, anyone can help me (dummy) with this.
Thanks und regards,
Robert
I have a convert command that produces a png file which is too big for my purposes. I get files with more than 200 kb but it should be less than 50 kb, if this is possible. How do I have to modify the parameters? What can I do? The quality of the image should be as close as possible to the original file. Note: the in.png could be also an in.jpg (or other supported formats). All works fine so far. Just the file is too big.
Code: Select all
/usr/bin/convert -size 160x160 xc:none \(
"in.png" -strip -thumbnail "140x140^" -gravity center -crop 140x140+0+0 +repage \(
+clone -fill black -colorize 100% -fill white -draw "translate 70,70 circle 0,0 70,0"
\)
-alpha off -compose copy_opacity -composite
\)
-alpha Set -compose src-over -composite -fill none -stroke "#0000FF" -strokewidth 10 -draw "translate 79.5,79.5 circle 0,0 74,0" "out.png"
Hope, anyone can help me (dummy) with this.
Thanks und regards,
Robert