Image management and optimization strategy

Tools and utilities for images

  1. Regenerate Thumbnails in bulk in WordPress
    1. WPCLI media command wp media regenerate --noprompt (best choice for command line)
    2. Force Regenerate Thumbnails plugin (most reliable, also to delete unused thumbnail sizes)
    3. AJAX Thumbnail Rebuild plugin (preferable UI, not totally reliable)
    4. Regenerate Thumbnails plugin
  2. Resize images in Î…WordPress Media Library

    1. Imsanity plugin to prevent large images being uploaded
      • Imsanity WPCLI wp imsanity resize to mass resize existing images
    2. GraphicsMagick command line tool
  3. Delete unused images in WordPress

    1. Media cleaner plugin to delete old unattached/unused images
      • seems to be missing images at times
    2. Bulk delete plugin to massively delete old posts
      • Delete posts, then delete unattached images or delete images by date
  4. Compress existing images in WordPress

    1. Our crunch.php utility to unconditionally compress and resize all images, originals and thumbnails (best results, not always good with PNGs, use with caution because it does massive changes to files)
    2. TinyPNG plugin for all images
      • Best compression ever, small free plan, best for new sites with few images.
    3. Jpegoptim and Optipng command line utilities.
  5. PNG to JPG conversion in in WordPress to transform PNGs to JPGs
    • breaks some images occasionally

General strategy for images in websites

    • Prefer JPEG by default
      • JPEG at 82 quality as rule of thumb
      • Or even lower if you can - trust your eye
      • Use Photoshop > File > Save for web
    • Prefer PNG24
      • When image has transparency
      • And that is absolutely necessary
      • Use TinyPNG to optimise them
    • Prefer PNG8
      • When image has very few colours with no gradients
      • Choose as few colours as possible
    • Prefer GIF
      • When animation with few frames is necessary
    • Prefer SVGs
      • For clean, vector graphics
    • Prefer videos
      • For easy/small animations (not SVG ones)