BD Image Optimizer

Getting Started with BD Image Optimizer

Updated March 9, 2026 5 min read

Introduction

BD Image Optimizer is a WordPress plugin that compresses images using the PHP GD library, converts them to WebP format, automatically resizes oversized images, and generates AI-powered alt text using the Claude API. It works entirely on your server (no external compression service required) and supports both auto-optimization on upload and bulk processing of your existing media library.

Requirements

  • WordPress 6.0 or later
  • PHP 7.4 or later
  • PHP GD extension (required for all image processing)
  • GD WebP support (required for WebP conversion — most modern PHP installations include this)
  • A valid BD Image Optimizer license key (required for optimization features)
  • An Anthropic API key (required only for AI alt text generation, Professional or Agency tier)

Installation

  1. Download the bd-image-optimizer plugin ZIP file from your BDShield account at getbdshield.com/shop.
  2. In your WordPress admin, go to Plugins → Add New → Upload Plugin.
  3. Select the ZIP file and click Install Now, then Activate.
  4. After activation, you will be redirected to the BD Image Optimizer dashboard at BD Image in your admin sidebar.

Activating Your License

  1. Go to BD Image → License tab.
  2. Enter your license key and click Activate.
  3. Once activated, the header displays a green “Licensed” pill and your tier badge.
  4. License details including expiration date and site count are shown.

Important: A valid license is required for all image optimization features. Without a license, the dashboard and statistics are viewable but the optimize and auto-optimize functions are disabled.

What BD Image Optimizer Does

BD Image Optimizer provides four core capabilities:

1. Image Compression

Images are compressed using the PHP GD library with a configurable quality setting (1-100, default: 82). The plugin processes both JPEG and PNG formats:

  • JPEG images: Compressed using imagejpeg() with your configured quality percentage. A quality of 82 provides an excellent balance between visual quality and file size reduction.
  • PNG images: Compressed using imagepng() with an automatically calculated compression level. The quality setting is mapped to PNG’s 0-9 scale (higher quality = lower compression level). Alpha transparency is preserved.

Both the original full-size image and all generated thumbnails are compressed. If the compression saves less than 5% of the original file size, the optimization is skipped and the original is preserved.

2. WebP Conversion

When enabled, the plugin creates a WebP version of every optimized image (including thumbnails). WebP typically provides 25-35% smaller files compared to JPEG at equivalent visual quality.

  • WebP files are created alongside the original with a .webp extension appended (e.g., photo.jpg.webp).
  • WebP quality uses the same compression quality setting as JPEG/PNG compression.
  • PNG images with alpha transparency are properly handled in WebP conversion.
  • A Serve WebP on Frontend option automatically wraps <img> tags in <picture> elements with a WebP source, so browsers that support WebP will load the smaller file while older browsers fall back to the original format.

Note: WebP conversion requires your server’s GD library to have WebP support compiled in. The plugin automatically checks this and disables the WebP option if support is not available.

3. Large Image Resizing

Images exceeding the configured maximum dimensions (default: 2560 x 2560 pixels) are automatically resized proportionally before compression. This prevents excessively large images from consuming unnecessary disk space and bandwidth.

  • The aspect ratio is always maintained — images are scaled down to fit within the maximum dimensions.
  • Resizing uses GD’s imagecopyresampled() for high-quality downscaling.
  • PNG transparency is preserved during resizing.

4. AI Alt Text Generation

BD Image Optimizer can automatically generate descriptive alt text for your images using the Claude API (Anthropic’s AI). This feature requires a Professional or Agency license tier and your own Anthropic API key.

  • Uses Claude Haiku, the fastest and most cost-effective model.
  • Images are resized to a maximum of 1024 pixels (in memory, not on disk) before being sent to the API, minimizing API costs.
  • Supports 12 languages: English, Spanish, French, German, Italian, Portuguese, Dutch, Arabic, Japanese, Chinese, Korean, and Russian.
  • Generated alt text is stored in the standard WordPress _wp_attachment_image_alt post meta field, so it works everywhere WordPress displays alt text.
  • The AI is instructed to produce concise 1-2 sentence descriptions suitable for screen readers, without starting with “Image of” or “Photo of”.

Auto-Optimize on Upload

When enabled (default), BD Image Optimizer automatically processes new images as they are uploaded to your media library. Here is how it works:

  1. You upload an image through the WordPress media uploader (or any plugin that creates attachments).
  2. The plugin hooks into wp_generate_attachment_metadata, which fires after WordPress processes the upload and generates thumbnails.
  3. The actual optimization is deferred to the PHP shutdown event so it does not block the upload response — your upload completes immediately.
  4. During shutdown, the plugin compresses the full-size image, creates a WebP version (if enabled), resizes it if too large, and processes all generated thumbnails.
  5. The original file is backed up (if backup is enabled) before any changes are made.

To enable or disable auto-optimize:

  1. Go to BD Image → Settings tab.
  2. Toggle the Auto-Optimize on Upload switch.
  3. Click Save Settings.

Note: Auto-optimize requires an active license. If your license expires or is deactivated, newly uploaded images will not be auto-optimized.

Skip Small Files

Files smaller than the configured threshold (default: 10,240 bytes / 10 KB) are automatically skipped during optimization. Very small images gain little from compression and the overhead is not worthwhile. You can adjust this threshold in the Settings tab.

Dashboard Overview

The BD Image Optimizer dashboard is accessible via BD Image in your admin sidebar. It has five tabs:

Dashboard Tab

Displays four statistics cards at the top:

  • Images Optimized — Total number of unique attachments that have been compressed or resized.
  • Space Saved — Total bytes saved across all optimizations, displayed in human-readable format (KB, MB, GB).
  • WebP Created — Number of WebP versions generated.
  • Alt Texts Generated — Number of images that received AI-generated alt text.

Below the statistics, a Recent Activity table shows the last 10 optimization events with the filename, action type (Compressed, Resized, Alt Text), savings percentage, and date.

Optimize Tab

Run bulk optimization on all unoptimized images in your media library. Displays a progress bar during processing and a detailed optimization log showing original size, optimized size, savings percentage, WebP size, and a restore button for each image.

Alt Text Tab

Generate AI alt text in bulk for all images missing alt text. Requires a Professional or Agency license and a configured Claude API key. Shows a progress bar and status during generation.

Settings Tab

Configure optimization behavior: auto-optimize, WebP generation, WebP serving, backup originals, compression quality, maximum dimensions, small file threshold, and alt text language.

License Tab

Manage your license key and view a plan comparison table showing the features and limits for each tier.

Server Compatibility

BD Image Optimizer checks for GD library availability on page load. If GD is not installed or does not support the required functions, a warning is displayed:

  • GD Library Missing: If the PHP GD extension is not loaded, a red warning banner appears on all tabs. Contact your hosting provider to enable the GD extension.
  • WebP Not Supported: If GD does not include WebP support, the “Generate WebP” checkbox is disabled with a note. JPEG and PNG compression still work normally.

Next Steps

Continue to Bulk Optimization & AI Alt Text to learn how to run bulk optimization, configure compression settings in detail, manage backup originals, and set up AI alt text generation.