Codeinwp / optimole-wp

30 stars 8 forks source link

Allow individual image compression levels on Cloud Library images via the WordPress dashboard #625

Open Nazrinn opened 1 year ago

Nazrinn commented 1 year ago

What problem does this address?

Sometimes, different images can handle different levels of compression and still look good within their context. An image that is used as a background with an overlay, for instance, can allow for heavier compression than, let's say, a product picture.

Additionally, the alternative of decreasing the image quality to the same level everywhere can result in mixed apperances; some images will look fine while others won't.

What is your proposed solution?

Be able to tweak the compression level on individual images via the cloud library, with the "default" or "current" compression level clearly indicated.

Will this feature require documentation? (Optional)

Yes, it requires documentation.

selul commented 1 year ago

Thanks for the suggestion, @Nazrinn! This is certainly a great idea. At present, we're using an autoquality feature that predicts the quality to ensure the saved image will have at most a 0.001 DSSIM difference from the original.

Also, I believe implementing this feature would require a format selector for the image. This is due to the fact that a quality setting of 80 on WebP, for example, might not correspond to the same quality on JPEG or AVIF?

Or were you thinking more of an abstract quality selector, such as one with 'aggressive', 'high', 'medium', 'low' options?

Nazrinn commented 1 year ago

Something more abstract would fit yes. The important is that the compressed images look about "the same" regardless of the format. I think that's the system you use when users enable manual compression as well?