How to generate multiple file formats of an image?
-
Hi,
Can WordPress support multiple file formats (file types) for automatically resized versions of an image?
For example, if I wanted to offer web browsers a choice of image format, for compatibility and performance purposes, I might typically want to display an image in the following basic manner:
<picture> <source srcset="image.avif" type="image/avif"> <source srcset="image.webp" type="image/webp"> <source srcset="image.jpg" type="image/jpeg"> <img src="image.jpg"> </picture>
Furthermore, just like the default resizing behavior, I would require these to be created when the original image was initially uploaded, each format along with the various resized versions of it, e.g. image.webp, image-150×150.webp, image-300×300.webp etc.
I realize that this will result in a multiplication of images, but that is not a concern to me in this instance.
Is there a way to do this?
Thanks in advance.
Paul S.
- The topic ‘How to generate multiple file formats of an image?’ is closed to new replies.