• Resolved SUP3RGIU

    (@sup3rgiu)


    Hi,
    I would like to ask if it’s possible to add an input field in the plugin settings to specify a custom image quality.

    Or alternatively add a filter to then be able to add a custom quality through functions.php.

    Actually I tried adding a new value in the function get_values inside the ImagesQualityOption class and the new quality is correctly displayed in the settings (and also the conversion uses this quality). So I don’t think it would be hard to add (to avoid editing the sources files)

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hello @sup3rgiu,

    Thanks for your message.

    Why do you need such settings? What quality would you like to set?

    Best,
    Mateusz

    Thread Starter SUP3RGIU

    (@sup3rgiu)

    For some specific images I use a quality between 85 and 90, like 87.
    I find that for these specific images this is the quality that best squit (yep, not 85 or 90).

    But I think that in general this could be a useful feature.

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @sup3rgiu I added a filter to the plugin that allows you to modify the list of quality levels. Please download the beta version of the plugin (I will add the changes in the next official plugin update):
    https://mattplugins.com/files/webp-converter-for-media-4.3.3-beta1.zip

    And then add the following code in functions.php in your theme directory:

    add_filter( 'webpc_option_quality_levels', function( $levels ) {
    	$levels[] = 87;
    	return $levels;
    } );

    Please let me know if everything is working properly.

    Thread Starter SUP3RGIU

    (@sup3rgiu)

    I confirm that is works as expected.

    Thank you very much!

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @sup3rgiu I am very happy that I could help.

    I also encourage you to try the AVIF format if you want to precisely adjust the weight of the images there. The AVIF format allows you to reduce the weight of images by an additional 25% compared to WebP.

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

The topic ‘Custom image quality’ is closed to new replies.