views:

78

answers:

3

Hi all,

I'm maintaining a site that has thousands of images that have not been compressed nearly enough. The homepage weighs in at 1.5 Mb currently, and it could easily be way less that half that.

I'm looking for some kind of tool that'll take a folder full of JPG pictures and will recompress them to their "optimal" compression value.

Obviously, "optimal lossy compression setting" is an oxymoron, but I'm thinking maybe a tool that'll try different levels and compare the outputs to the input, and choose a "sweet spot" between size and destruction?

Or even try whether PNG is a better option, many times it is, for "drawing" type stuff.

Does anyone of you know any such tool?
I'd have lots of fun coding one, but I bet someone already did and will save me 2 days.

Alternatively, of course, anything that'll take all pictures in a folder and recompress them with a fixed quality level (say, 40) will also work, it'll just not make my inner nerd as happy, but it'll solve my problem just fine.

(Ideally something that can run on Windows, ideally from the command line)

Thank you!

A: 

If you are looking for a non-programming approach (kind of the wrong idea here on SO...) you could try IrfanView's batch feature. It's a lightweight image editor that will let you batch convert images based on a few simple criteria (such as file dimensions, etc.)

JYelton
+3  A: 

I used ImageMagick for that purpose. It consist of a lot of things, among which a set of commandline tools that can be used to chain image operations along each other.

It is fun to experiment on the commandline, copy it in a script and let it rip over a couple thousand images. I found the default quality of the resulting images also pretty good.

Here is the website. I used it under Linux, but I saw there is a windows version too.

Peter Tillemans
+1  A: 

For optimizing png's, pngout is king

Anders