Filters the default image compression quality setting.
Description
Applies only during initial editor instantiation, or when set_quality() is run manually without the $quality argument.
The WP_Image_Editor::set_quality() method has priority over the filter.
Parameters
$qualityint- Quality level between 1 (low) and 100 (high).
$mime_typestring- Image mime type.
$sizearray- Dimensions of the image.
widthintThe image width.heightintThe image height.
Source
$quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type, $dims ? $dims : $this->size );
This sets the default compression quality used in WP_Image_Editor, the class used for manipulating images. Do note that the if the image is a JPEG image (mime type == ‘image/jpeg’) this filter is superceded by the jpeg_quality filter and effectively will not be used.
Default image quality is 90 for WEBP and AVIF.
https://github.com/WordPress/wordpress-develop/blob/6.7/src/wp-admin/includes/image-edit.php#L390
Since there is no way to remove past comment – I have to correct this one, webp default quality is now set to 90, as commenters above had mention.
Default quality for webp image (
image/webp) is 86.