Compression setting
-
I’m trying to change the amount images get compressed when using this plugin, but the filter does not seem to be working – is there something in the plugin that needs changing?
Sorry for the vague question – here is what I’ve tried, then deleting the cached images so it regenerates.
Thanks// 1) Force Imagick first (fallback to GD if Imagick isn’t available)
add_filter( ‘wp_image_editors’, function( $editors ) {
return [ ‘WP_Image_Editor_Imagick’, ‘WP_Image_Editor_GD’ ];
}, 10, 1 );// 2) Set quality for all formats, including PNG
add_filter( ‘wp_editor_set_quality’, function( $quality, $mime_type, $dims = null ) {
if ( $mime_type !== ‘image/png’ || empty( $dims[‘width’] ) ) {
return $quality;
}
return 95;
}, 10, 3 );
The topic ‘Compression setting’ is closed to new replies.