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
$max_depthint
The maximum bit depth. Default is the input depth.
794*795* @since 6.8.0796*797* @param int$max_depth The maximum bit depth.Default is the input depth.798* @param int$image_depth The bit depth of the original image.799*/800$max_depth=apply_filters('image_max_bit_depth',$this->image->getImageDepth(),$this->image->getImageDepth());801$this->image->setImageDepth($max_depth);802}803}catch(Exception$e){804returnnewWP_Error('image_resize_error',$e->getMessage());805}806}
History
Introduced in 6.8.0. Unchanged from 6.8.8 through 7.1.0.