Does WebP support transparency?

I can convert all my images to WebP using ImageKit. But some of the logos I have have a transparent background? If I convert them to WebP, will the transparency be maintained or will I end up getting a black or white background like a JPEG image?

WebP supports transparency. If you convert a PNG image with transparency to WebP using the f-webp parameter, transparency would be retained.

Even if you use auto format optimization for images, if the input image contains a transparency, it would be retained in the output WebP image.

Yes, ImageKit preserves transparency when converting images—like logos or icons with transparent backgrounds—to the WebP format.

Why Does Transparency Remain Intact?

WebP is a modern image format that supports alpha transparency, much like PNG. This means transparent areas in your source image (e.g., PNG ) will remain transparent after conversion to WebP. You won’t end up with a black or white background as you might with JPEG, which does not support transparency.

Whether you convert images to WebP using one of the following methods, transparency will be retained:

Original Transparent Image:

https://ik.imagekit.io/ikmedia/docs_images/product_image_1.png
  • Automatic Format Conversion (f-auto):
    ImageKit automatically selects the most suitable format for the user’s device and browser when the “Use best format for image delivery” setting is enabled in the dashboard or when the f-auto parameter is used in the image URL. If the original image contains transparency, ImageKit ensures that it is preserved by delivering the image in a format that supports transparency—such as WebP.
https://ik.imagekit.io/ikmedia/docs_images/product_image_1.png?tr=f-auto
  • Forced Format Conversion (f-webp):

You can manually convert the image to WebP by appending the format parameter f-webp in the transformation string. Transparency will still remain intact.

https://ik.imagekit.io/ikmedia/docs_images/product_image_1.png?tr=f-webp