Title: image_max_bit_depth
Published: April 28, 2025
Last modified: May 20, 2026

---

# apply_filters( ‘image_max_bit_depth’, int $max_depth, int $image_depth )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/image_max_bit_depth/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/image_max_bit_depth/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/image_max_bit_depth/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/image_max_bit_depth/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/image_max_bit_depth/?output_format=md#changelog)

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

Filters the maximum bit depth of resized images.

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

This filter only applies when resizing using the Imagick editor since GD does not
support getting or setting bit depth.

Use this to adjust the maximum bit depth of resized images.

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

 `$max_depth`int

The maximum bit depth. Default is the input depth.

`$image_depth`int

The bit depth of the original image.

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

    ```php
    $max_depth = apply_filters( 'image_max_bit_depth', $this->image->getImageDepth(), $this->image->getImageDepth() );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-image-editor-imagick.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-image-editor-imagick.php#L600)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-image-editor-imagick.php#L600-L600)

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

| Used by | Description | 
| [WP_Image_Editor_Imagick::thumbnail_image()](https://developer.wordpress.org/reference/classes/wp_image_editor_imagick/thumbnail_image/)`wp-includes/class-wp-image-editor-imagick.php` |

Efficiently resize the current image

  |

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

| Version | Description | 
| [6.8.0](https://developer.wordpress.org/reference/since/6.8.0/) | Introduced. |

## User Contributed Notes

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