Your awesome WordPress site can really get bogged down by uploading lots of large images. First off, the Resize Image After Upload plug-in is EXCELLENT. Set the limits to the largest height and width you might display images on your site and the plugin will automatically scale images to that maximum dimension, dump the META data and re-compress your jpg images to a level you specify.

Now you can upload images directly off your camera without creating a huge slow site. A typical 3MB image off a camera ends up being around 50kB. I’ve run the resize in photoshop and then saved for web and they end up effectively the exact same size with no difference in clarity.

For the files you’ve already uploaded, here is a neat trick – these are the Windows instructions but all these programs are available for unixes and Mac OS with minor modifications in the syntax.

  1. Download and install Image Magick http://www.imagemagick.org/www/binary-releases.html
  2. Download your entire /wp-content/uploads folder
  3. Open the command prompt, switch to the uploads folder
  4. Run this command
    This sets the max height and width of all the jpgs in the uploads folders to 1280, maintains aspect ratio of the images and doesn’t resize images smaller than the dimensions. Adjust the numbers to whatever you want but this is a good max dimension for a responsive site
    FOR /R %f IN (*.jpg) DO convert “%f” -resize “1280×1280>” “%f”
  5. Upload the uploads folder back to your host – all set!

Thanks to Wolfgang Hugemann from the Image Magick forums for the command line.