Title: Reduce Compression
Last modified: January 2, 2025

---

# Reduce Compression

 *  [mananmushtaq02](https://wordpress.org/support/users/mananmushtaq02/)
 * (@mananmushtaq02)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reduce-compression/)
 * While uploading woocommerce images we already compress files at our on photoshop,
   but when they are uploaded and converted to webp format by your plugin the images
   are compressed more than what we expect. Is there any setting where compression
   level can be adujusted?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Freduce-compression%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reduce-compression/#post-18222199)
 * Thanks for reaching out [@mananmushtaq02](https://wordpress.org/support/users/mananmushtaq02/).
   Images will only be generated in modern image formats if the output image is 
   lower in file size than the one uploaded.
 * > Is there any setting where compression level can be adujusted?
 * You can use `wp_editor_set_quality` to change the modern image format quality.
   Below is an example:
 *     ```wp-block-code
       function filter_img_quality( $quality, $mime_type ) {	if ( 'image/avif' === $mime_type ) {		return 55;	}	return $quality;}add_filter( 'wp_editor_set_quality', 'filter_img_quality', 10, 2 );
       ```
   
 * Hopefully the above is of use. Let me know if you have any questions with the
   above.
 *  Thread Starter [mananmushtaq02](https://wordpress.org/support/users/mananmushtaq02/)
 * (@mananmushtaq02)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reduce-compression/#post-18222412)
 * In below code I changed $quality = 86; to $quality = 16; and $quality = 96; aswell.
   But nothing changed in compression quality when I uploaded an image again.
 * Is there something else to be done
 * /**
   * Returns the default compression quality setting for the mime type.** [@since](https://wordpress.org/support/users/since/)
   5.8.1** [@param](https://wordpress.org/support/users/param/) string $mime_type*
   [@return](https://wordpress.org/support/users/return/) int The default quality
   setting for the mime type.*/protected function get_default_quality( $mime_type){
   switch ( $mime_type ) {case ‘image/webp’:$quality = 86;break;case ‘image/jpeg’:
   default:$quality = $this->default_quality;}
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reduce-compression/#post-18222568)
 * Is it possible that the image you’re trying to upload is already very low in 
   file size? Feel free to share a link for me to check with if you wish.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Reduce Compression’ is closed to new replies.

 * ![](https://ps.w.org/webp-uploads/assets/icon.svg?rev=3098226)
 * [Modern Image Formats](https://wordpress.org/plugins/webp-uploads/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/webp-uploads/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/webp-uploads/)
 * [Active Topics](https://wordpress.org/support/plugin/webp-uploads/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/webp-uploads/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/webp-uploads/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/reduce-compression/#post-18222568)
 * Status: not resolved