Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I've got quite a few images on my site, which I want to optimize. They are scattered all through the folder structure. My question is: Is there a server based perl module or tool I can use, which will let me optimize them all at once? I don't really fancy having to download maybe 300+ images from around the site, compress them, and then making sure I upload them to the correct locations =)

TIA

Andy

Replies are listed 'Best First'.
Re: Script to optimize images?
by marto (Cardinal) on Jul 30, 2010 at 13:44 UTC
Re: Script to optimize images?
by ww (Archbishop) on Jul 30, 2010 at 20:49 UTC

    Optomize how?

    • For fastest rendering? <Selected because of your words, "compress them"> (If so, how much are you willing to allow quality to degrade?)
    • for some particular image size: compression level, width, height, and colors?
    • for something(s) else?

    And in this context, what does "optimize them all at once" mean to you?

    • use a single script applied verbatim to each image?
    • automatically find and load all (or some subset of "all") images into an image editor and allow you to focus only an whatever aesthetic or technical conditions(s) you consider optimum before an automated save back to the server?
    • or something else?

    Please see I know what I mean. Why don't you?

Re: Script to optimize images?
by AndyZaft (Hermit) on Jul 30, 2010 at 13:35 UTC
    Your first stop could be Image::Magick or GD, assuming you are going to write something yourself. I'm sure there is a script out there already that will offer you conversion to better compressed jpg or something similar though.
Re: Script to optimize images?
by Anonymous Monk on Jul 30, 2010 at 12:42 UTC
    What do you mean optimize?