---
title: "Discussion on \"How to serve different image formats in websites using the HTML5 picture tag?\" | Hashnode"
description: "Discussion on \"How to serve different image formats in websites using the HTML5 picture tag?\". Originally posted here!\n\nWhy do we need to serve different image formats?\nSince the introduction of WebP image format by Google, many of the sites are converting to use WebP format to increase performance, Since JPEG images are larger than WebP and t..."
url: "https://hashnode.com/posts/serve-different-image-formats-using-picture-tag-html5/5fd50ddc27af257395891152"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to serve different image formats in websites using the HTML5 picture tag?](https://melvingeorge-me.hashnode.dev/serve-different-image-formats-using-picture-tag-html5?utm_source=hashnode&utm_medium=feed)

Originally posted here! Why do we need to serve different image formats? Since the introduction of WebP image format by Google, many of the sites are converting to use WebP format to increase performance, Since JPEG images are larger than WebP and t...

Dec 12, 2020 · 4 min read · melvingeorge-me.hashnode.dev  
Read the article

-   [#programming](https://hashnode.com/tag/programming)

## Written by

[MELVIN GEORGE](https://hashnode.com/@melvingeorge)

@melvingeorge · Bangalore

  
[View profile](https://hashnode.com/@melvingeorge)

Hi, I'm Melvin George! 🖐️. A web developer and a blogger.

Hi, I'm Melvin George! 🖐️. A web developer and a blogger. I’ve written code for Mozilla, Qiskit, and an active contributor to many frontend open-source projects that are being used by millions of people around the world. 🚀 I love JavaScript, Rust, React.js, and many new exciting technologies that help society to find a solution to an existing problem 💖. Come check out my blog to see more of software development posts on these technologies. 🦄

## Responses 1

Markdown supported · ⌘↵ to post

[Kerem](https://hashnode.com/@gl0kom)

[Dec 13, 2020](https://hashnode.com/posts/serve-different-image-formats-using-picture-tag-html5/5fd50ddc27af257395891152/comment/5fd61733f60e3973bae6c299)

i checked on iPhone and saw a Hause. Then i find in code for Safari but that was a mause.

[MELVIN GEORGE](https://hashnode.com/@melvingeorge)

[Dec 13, 2020](https://hashnode.com/posts/serve-different-image-formats-using-picture-tag-html5/5fd50ddc27af257395891152/comment/5fd61733f60e3973bae6c299#reply-5fd64828f60e3973bae6c5d8)

[Kerem](https://hashnode.com/@gl0kom)

That's intended. 🙂

In some of the Safari browsers `webp` image formats are not supported yet and thus it will show the picture of the mouse image which is a `jpg` image.

If you open the link in chrome browser, it will show the image of the house which is a `webp` image since chrome supports `webp` images.

I made the code like that to show that it will show different images in different browsers.
