I have some images in .GIF format which i want to compress. But i am getting the output either same or hardly 2-5% compression.I need higher compression ratio so that the web pages can be loaded fastly. Currently i am using the gifsicle tool but hardly i am finding much difference in size of the generated gif images. I opted this tool from yahoo smush it.
gifsicle -O3 gifimage1.gif -o new-gifimage1.gif
UPDATE:
The giflossy
fork has been merged into gifsicle
now, so you will be able to use the --lossy
flag with gifsicle
now (with the latest version), no need to install giflossy
separately.
If you want to enable lossy compression which reduces the size considerably, you can use giflossy fork of gifsicle. Once you have installed it you can use the lossey option as below
gifsicle -O3 --lossy=80 gifimage1.gif -o new-gifimage1.gif
Installation:
brew install giflossy
You can use below command to tweak your compression options
gifsicle -O3 --colors=64 --use-col=web --lossy=100 --scale 0.8 gifimage1.gif -o new-gifimage1.gif
Gifsicle's --optimize
option will only attempt lossless reduction of an image's file size. What you probably have* is an animated gif where each frame contains random dithering, so most of the pixels will change from one frame to the next.
If your original GIF image had used pattern dithering, you would be able to compress it a lot more. But if that's not an option, I suggest you try either reducing the dimensions of the image (e.g., --scale 0.5
), or reducing the number of colours in it (e.g., --colors 16
).
* (I'm only guessing, since you didn't bother to share your image)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With