Right now all audits to plain Drupal websites get the warning "Serve images in next-gen formats".


Since this something increasingly important to all Drupal installs, we should consider supporting some of the "next-gen" formats.



- Imagem from auditing drupal.com


The formats that Google Lighthouse indicates are JPEG 2000, JPEG XR, and WebP that still have limited browser support.
In order to make it work on all Drupal supported browsers, we would need to have a fallback strategy.

We would need to be able to also generate images on that formats from the image style, and then make them available on the generated markup.

<picture>
  <source srcset="img/yourImage.webp" type="image/webp">
  <source srcset="img/yourImage.jpg" type="image/jpeg"> 
  <img src="img/yourImage.jpg" alt="Your image">
</picture>
CommentFileSizeAuthor
Screenshot 2019-10-09 at 11.03.30.png88.65 KBrfmarcelino

Comments

rfmarcelino created an issue. See original summary.

cilefen’s picture

Version: 9.x-dev » 8.8.x-dev
Status: Active » Postponed (maintainer needs more info)

Could you please add to the issue a definition of these formats?

rfmarcelino’s picture

Issue summary: View changes
rfmarcelino’s picture

Status: Postponed (maintainer needs more info) » Active

Additional info added.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

jaimeah’s picture

Here is an explanation of the formats. You can see different formats are compatible with different browsers, which seems to be the major difference:

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mgifford’s picture

Issue tags: +Performance, +sustainability, +sustainableux, +climatechange, +webp, +jpeg xr, +AV1

This is something that would be really useful to reduce the CO2 footprint of sites using Drupal. Could really help with performance too (obviously).

Would be nice if this were centralized in Drupal so that whenever the next fast format comes out, it can be more easily adopted.

phenaproxima’s picture

Component: media system » image.module

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

mgifford’s picture

Issue tags: -sustainableux
mgifford’s picture

Issue tags: -climatechange

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sd123’s picture

@jaimeah: I would skip support for JPEG XR and JPEG 2000. Instead add support for AVIF and for sure JPEG XL which allows for backward compatibility with JPEG.

mgifford’s picture

Doesn't seem to be a lot of support for JPEG XL https://caniuse.com/?search=JPEG%20XL

AVIF & WebP look ready to roll though:
https://caniuse.com/?search=avif
https://caniuse.com/?search=webp

Also, we can build on the work of another CMS that's already moved this way:
https://wagtail.org/blog/wagtail-greener-and-leaner/

sd123’s picture

I think both JPEG XL and AVIF support will be best to have. The first format will be better in the long run since it will allow an easy and painless transition of existing websites because of it backward compatibility features with JPEG.

mgifford’s picture

sd123’s picture

As JPEG XL industry adoption is gaining momentum with now also Google changing their mind regarding JPEG XL and experimental support already returned to Chrome Canary, it is maybe an opportunity to focus on this now.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

catch’s picture