media-experiments icon indicating copy to clipboard operation
media-experiments copied to clipboard

Add option for progressive image output

Open swissspidy opened this issue 2 years ago • 5 comments

https://core.trac.wordpress.org/changeset/57607

Vips supports it, but this needs to be carefully implemented as it throws an error if providing the progressive option for a format that doesn't support it.

Question: One general option in the modal or one for each format (like quality)?

swissspidy avatar Feb 13 '24 09:02 swissspidy

I would like to enable it only for jpgs for example, and I think doing like "one for each format" is preferable to give users more granularity in the choice of the preferred encoding method

erikyo avatar Feb 13 '24 13:02 erikyo

There's gonna be so many options eventually 😄

swissspidy avatar Feb 13 '24 13:02 swissspidy

you are right but progressive jpg are preferable while a progressive png can size the 20% more than the "standard" one (and that's why I would avoid enabling it for pngs)

erikyo avatar Feb 13 '24 14:02 erikyo

Implementation notes for myself:

Add a hardcoded map with available options per format with types and everything (schema?). Then loop through them according to the chosen output format.

Setting key might be confusing, e.g. if jpeg_outputFormat is AVIF, then AVIF quality would be under jpeg_quality? Or better jpeg_avif_quality? Do we delete stale preferences after changing formats?

swissspidy avatar Feb 16 '24 21:02 swissspidy

Quality input & progressive toggle could be displayed side by side with 50% width using flexbox in order to save space.

There might be more preferences in the future though, so some toggle might be useful to show/hide advanced settings

swissspidy avatar Feb 20 '24 14:02 swissspidy

From https://github.com/swissspidy/media-experiments/issues/347#issuecomment-2139645667:

Aside: this is missing a "default image quality" input

swissspidy avatar Jun 11 '24 15:06 swissspidy

New layout:

Screenshot 2024-06-22 at 14 43 29 Screenshot 2024-06-22 at 14 43 19

swissspidy avatar Jun 22 '24 12:06 swissspidy

Useful testing tool: https://google.github.io/attention-center/

swissspidy avatar Jun 22 '24 15:06 swissspidy