• Hi.

    I had a jpeg image size 120kb and the plugin gave me a webp version size 93kb so I need the compression level to be more lossy.

    So how can I make the compression level more lossy. I want max of 20kb webp images.

Viewing 1 replies (of 1 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    Great question @spreaditunlimited. You can lower the quality from the default 82 using the below filter. You can modify this to suit your needs.

    function set_webp_quality( $quality, $mime_type ) {
      if ( 'image/webp' === $mime_type ) {
       return 50;
      }
      return $quality;
    }
    add_filter( 'wp_editor_set_quality', 'set_webp_quality', 10, 2 );

    If you want to preview your image before uploading, or even generate WebP that matches your desired file size, you can use the squoosh.app site.

Viewing 1 replies (of 1 total)
  • The topic ‘How to increase compression level of webp image output’ is closed to new replies.