- Issue created by @catch
- First commit to issue fork.
- 🇦🇺Australia mstrelan
I installed Umami profile on 11.x (WEBP) and then on this branch (AVIF) then ran
wget --mirror
to warm all the image styles. The results are below. We save around 2.5 MB (40%) using AVIF.WEBP:
$ du -s sites/default/files/styles/ 6704 sites/default/files/styles/
AVIF:
$ du -s sites/default/files/styles/ 4144 sites/default/files/styles/
Below shows a comparison for each style:
| Image style | WEBP | AVIF | Saving | |-------------------------|------|------|----------| | large_3_2_2x | 2180 | 1412 | 35.23% | | large_3_2_768x512 | 952 | 628 | 34.03% | | medium_3_2_2x | 1548 | 876 | 43.41% | | medium_3_2_600x400 | 616 | 396 | 35.71% | | medium_8_7 | 20 | 16 | 20.00% | | scale_crop_7_3_large | 208 | 120 | 42.31% | | scale_crop_7_3_medium | 160 | 96 | 40.00% | | scale_crop_7_3_tiny | 44 | 28 | 36.36% | | scale_crop_7_3_wide | 584 | 324 | 44.52% | | square_large | 220 | 132 | 40.00% | | square_medium | 124 | 76 | 38.71% | | square_small | 48 | 40 | 16.67% |
Considering past discussions on efficiency of decoding AVIF, perhaps we could consider using WEBP by default for image styles with less than 35% saving. Or perhaps any other arbitrary number.
Also note, the following image styles exist outside of the any profiles subdirectory:
$ find . -type f -name 'image.style.*.yml' ! -path '*/profiles/*' ./core/modules/image/config/install/image.style.wide.yml ./core/modules/image/config/install/image.style.medium.yml ./core/modules/image/config/install/image.style.thumbnail.yml ./core/modules/image/config/install/image.style.large.yml ./core/modules/media_library/config/install/image.style.media_library.yml ./core/recipes/standard_responsive_images/config/image.style.max_2600x2600.yml ./core/recipes/standard_responsive_images/config/image.style.max_650x650.yml ./core/recipes/standard_responsive_images/config/image.style.max_325x325.yml ./core/recipes/standard_responsive_images/config/image.style.max_1300x1300.yml