Good morning everyone, how are you?
I am writing to you regarding the Avif format.
When I make an API call (nuxt) I get Avif images instead of webp (with Chrome).
Is this correct?
Maybe I don't know enough about it, but I would like to ask you how do I change it to webp.
The image you shared is a JPG file. Could it be that you have two identical images in different formats?
Do you use any kind of image management service outside of Prismic? These types of tools do automatic image format conversion. Such as from Webp or JPG to AVIF.
Hello!
Thank you for your reply.
I'm not using services external to prismic.
I have uploaded images (jpg) to prismic and I get avif directly from your api.
If I do an upload of a jpg, your api should return a webp to me if the browser supports it, is this correct?
Thank you
The API will return the same file format you upload to the Media Library.
The only automatic transformations done automatically are related to image compression:
Hey Leonardo. Yes, I'll be happy to help. Although, I'm not sure what is the reason why the format is changing within your site. The API will always returns the same format that you added to your documents. It can be some configuration within your code. For example, <nuxt-img> has a format property that allows you to change the format in which images are served: <nuxt-img>.
I just encountered the same issue as Leonardo. I run a website based on Prismic since three years. Our website uses responsive image resizing enabled by prismic and imigix. The resized images where never delivered in the original format (png or jpg) but until recently always as webp and as we realized now it changed to avif.
I have the impression that the avif compression is more pixelated in some situations than the former webp compression. In the image field configuration in the custom type generator there is no possibility to choose formats.
Any recommendation how to configure it?
It would be great to have the image compression described more closely in the docs!
Would it be possible to choose the compression format with the images API: to receive Avif, Webp or even Jpgs or Pngs with reduced image dimensions, as specified within the custom type image field?