---
title: Image Pilot
date: 2024-11-19T14:06:47+00:00
modified: 2025-02-12T08:28:33+00:00
permalink: https://wpelevator.com/plugins/image-pilot
post_type: page
author:
  name: Kaspars
  avatar: https://secure.gravatar.com/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=robohash&r=g
---

# Image Pilot

**Rewrite image `src` and `srcset` URLs for optimized delivery of responsive sizes from services that support dynamic resizing such as Photon, Cloudflare Images and others.**

![Responsive image sizes generated by the Image Pilot plugin](https://wpelevator.com/wp-content/uploads/sites/12/2025/02/image-pilot-responsive-srcset-urls.png?strip=all&quality=90&resize=1716,1158)The plugin uses additional widths (384, 768, 1024, 1536 and 2048) for each of the defined image sizes to ensure that `wp_calculate_image_srcset` has plenty of sizes to use for each breakpoint width.

It is recommended to use image sizes `add_image_size()` to define the available aspect ratios instead of the different sizes. This ensures that editors only need to choose the aspect ratio when adding images to content and the responsive sizes are generated automatically.

Importantly, the plugin doesn’t disable intermediate image generation `wp_generate_attachment_metadata()` so may choose to disable that via the `intermediate_image_sizes_advanced` filter:

```
add_filter( 'intermediate_image_sizes_advanced', '__return_empty_array' );
```

## Usage

Use the `image_pilot__image_url` filter to specify the updated image URL for the specific sizes:

```
add_filter(
	'image_pilot__image_size_url',
	function ( string $url, \WPElevator\Image_Pilot\Image_Size $target_size ) {
		return $url; // Rewrite the original image URL to the resized URL.
	},
);
```