Image formats

WebP: what it is and how to serve it

WebP is the safe modern choice: much smaller than JPEG or PNG, with transparency, and supported by every current browser.

WebP

  • Files.webp
  • Fileboy reads itYes
  • Fileboy writes itYes

What it is

WebP is an image format from Google. One format covers what JPEG and PNG do separately: it has a lossy mode for photos, a lossless mode for graphics, transparency in both, and animation.

Files are often much smaller than the JPEG or PNG they replace, and it encodes far faster than AVIF.

Browser support

Every current browser shows WebP. Support gaps now are mostly outside the browser: some older email clients, design tools and upload forms that only accept JPEG or PNG.

Serve it with Fileboy

Media typeimage/webp
Read by the image pipelineYes
Written by the image pipelineYes

Fileboy reads and writes WebP. Ask for it with format:webp, or use format:auto, which sends WebP when the browser doesn't take AVIF.

Add the lossless transform to get a WebP that keeps every pixel, often smaller than the PNG it came from. Animated WebP files can't be transformed, so they are served as they are.

An image URL
https://api.fileboy.io/images/get/FILE_ID?transform=resize:1200x_;format:webp

Common questions

Does WebP keep transparency?

Yes, in both lossy and lossless mode, so a PNG with transparent areas can become a much smaller WebP.

Should I use WebP or AVIF?

Use format:auto and let the browser decide. It sends AVIF to browsers that take it and WebP to the rest, so you get the smallest file each can show.

Other formats

Add Fileboy to your next project

We built Fileboy to stop rebuilding file handling for every app. Create an app, paste your key and upload a file. The free plan needs no card.