And this is the code to change it:
// AVIF compression quality, for Modern Image Formats plugin
function filter_img_quality( $quality, $mime_type ) {
if ( ‘image/avif’ === $mime_type ) {
return 60; // quality set to 60
}
return $quality;
}
add_filter( ‘wp_editor_set_quality’, ‘filter_img_quality’, 10, 2 );
@westonruter any reason why it can’t be done via UI?
WordPress core doesn’t provide a UI to change the compression. The Performance Lab plugins are intended as feature plugins to be later merged into core, so the UI tries to be minimal. We try to maintain the “decisions, not options” philosophy.
Thanks for the explanation, @westonruter