WebP AVIF image formats

I’m using strapi for my small online-shop. it’s create that strapi provide differnt sizes out of the box. Do you plan add webp as acceptable image format?

  • Resizing works well for WebP. You may want to check if “Settings > Media Library > Responsive friendly upload” is set to true.
  • Unfortunately, AVIF cannot be resized at the moment, but you can still upload and use it.

Note: By default, images are not served. To serve them, add “?populate=*” at the end of the query.

I’m not sure I understood your question, so please correct me if I’m wrong. As of today, you cannot change the extension of a file with Strapi. However, there are other solutions:

On the front-end, styles may not help much after the photo is uploaded. However, you can change the format before uploading it by using the canvas in JavaScript. Refer to Uploading Canvas Image to a Server for an example.

You can extend the upload plugin with your own logic supporting wep etc using sharp to convert it.

I’m not so sure you can do that without changing the source code of the plug in, but I may be wrong

In case you’re looking for a simple solution to convert your images to WebP before uploading them to Strapi, I’d like to recommend a free tool that I’ve found to be quite reliable: Converter365. It’s an online converter that supports various formats, including WebP.

Here’s how to use it:

  1. Visit the Converter365 WebP
  2. Choose ‘Image Converter’ and then select ‘WebP’ as the output format.
  3. Click on ‘Choose File’ to upload the image you wish to convert.
  4. Click ‘Start conversion’.
  5. Once the conversion is complete, download your new WebP image.

Keep in mind that this is a manual solution, so if you’re handling a large number of images, a programmatic solution might be more efficient. But for small tasks, it works great.

I hope this helps! Let me know if you have any further questions.