Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

doc: automatic image optimisation detection

fenosbaad78bff74f
diff --git a/apps/docs/pages/guides/storage/image-transformations.mdx b/apps/docs/pages/guides/storage/image-transformations.mdx
index 98e3af03a79..0c558459810 100644
--- a/apps/docs/pages/guides/storage/image-transformations.mdx
+++ b/apps/docs/pages/guides/storage/image-transformations.mdx
@@ -59,6 +59,32 @@ supabase.storage.from('bucket').download('image.jpg', {
})
```
+## Automatic Image Optimisation Detection (WebP)
+
+When using the image transformation API we will automatically find the best format supported by the browser and return that to the client, without any code change.
+For instance, if you use Chrome when viewing a jpeg image and using transformation options, you'll see that the content-type returned is `webp`.
+
+In result, this will lower the bandwidth that you send to your users and your application will load much faster.
+
+<Admonition type="note">
+ We currently only support WebP, AVIF support will come in the near future
+</Admonition>
+
+**Disabling automatic optimisation:**
+
+In case you'd like to return the original format of the image and **opt-out** from the automatic image optimisation detection, you can pass the `format=origin` parameter when requesting a transformed image,
+this is also supported in the SDK starting from v2.2.0
+
+```ts
+await storage.from('bucket').download('image.jpeg', {
+ transform: {
+ width: 200,
+ height: 200,
+ format: 'origin',
+ },
+})
+```
+
## NextJS Loader
You can use Supabase Image Transformation to optimise your NextJS images using a custom [Loader](https://nextjs.org/docs/api-reference/next/image#loader-configuration).