Title: image_editor_output_format
Published: July 20, 2021
Last modified: February 24, 2026

---

# apply_filters( ‘image_editor_output_format’, string[] $output_format, string $filename, string $mime_type )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#wp--skip-link--target)

Filters the image editor output format mapping.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#description)󠁿

Enables filtering the mime type used to save images. By default HEIC/HEIF images
are converted to JPEGs.

### 󠀁[See also](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#see-also)󠁿

 * [WP_Image_Editor::get_output_format()](https://developer.wordpress.org/reference/classes/WP_Image_Editor/get_output_format/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#parameters)󠁿

 `$output_format`string[]

An array of mime type mappings. Maps a source mime type to a new destination mime
type. By default maps HEIC/HEIF input to JPEG output.

 * `...$0` string
 * The new mime type.

`$filename`string

Path to the image.

`$mime_type`string

The source image mime type.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'image_editor_output_format', $output_format, $filename, $mime_type );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/media.php#L6366)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/media.php#L6366-L6366)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_get_image_editor_output_format()](https://developer.wordpress.org/reference/functions/wp_get_image_editor_output_format/)`wp-includes/media.php` |

Determines the output format for the image editor.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.7.0](https://developer.wordpress.org/reference/since/6.7.0/) | The default was changed from an empty array to an array containing the HEIC/HEIF images mime types. | 
| [5.8.0](https://developer.wordpress.org/reference/since/5.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/image_editor_output_format/?output_format=md#comment-content-6382)
 2.   [Adam Silverstein](https://profiles.wordpress.org/adamsilverstein/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/image_editor_output_format/#comment-6382)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fimage_editor_output_format%2F%23comment-6382)
    Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fimage_editor_output_format%2F%23comment-6382)
 4. Use this filter to output WebP images when users upload JPEG images:
 5.     ```php
        function map_jpeg_to_webp( $mappings ) {
        	$mappings[ 'image/jpeg' ] = 'image/webp';
        	return $mappings;
        };
        add_filter( 'image_editor_output_format', 'map_jpeg_to_webp' );
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fimage_editor_output_format%2F%3Freplytocom%3D6382%23feedback-editor-6382)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fimage_editor_output_format%2F)
before being able to contribute a note or feedback.