Kilian / Trimage

A cross-platform tool for optimizing PNG and JPG files.
http://trimage.org
MIT License
706 stars 55 forks source link

Use pngcrush for even smaller png's #8

Closed bistory closed 14 years ago

bistory commented 14 years ago

I've made (again) a small modification on trimage allowing it to use pngcrush. I've reached deeper levels in lossless compression.

Again, interested ?

Kilian commented 14 years ago

Optipng is a fork of png crush. I was under the impression that, between the two, optipng is the better one. It would be nice to add pngcrush as well, provided it remains lossless! :)

bistory commented 14 years ago

Optipng has less cli options than pngcrush. For example, here is the command I added to get pngcrush working :

pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time '%(file)s' '%(file)s.bak'&&mv '%(file)s.bak' '%(file)s'

I'm not a pngcrush expert, so there is maybe redundant parameters but that works. It is very CPU hungry but it worth it, essentially with small files.

I think the result would be optimal if bug #1 was resolved (I'm working on it).

Kilian commented 14 years ago

That's awesome, i'll look into it :)

bistory commented 14 years ago

I made an other pull request, I integrated the small fix that use pngcrush.

So close this bug once you accepted the pull.

Thanks !

bistory commented 14 years ago

I tried this command : pngcrush -rem gAMA -rem alla -rem text -rem cHRM -rem iCCP -rem sRGB -rem time -reduce -cc '%(file)s' '%(file)s.bak'

That should be a little bit better but I didn't see a difference, maybe on some specific png's ?

Kilian commented 14 years ago

Added in 1.0.5, thanks :)