{"id":27747,"date":"2021-10-22T16:59:43","date_gmt":"2021-10-22T16:59:43","guid":{"rendered":"http:\/\/Responsive-Images-with-Resolution-Switching"},"modified":"2025-03-02T14:58:29","modified_gmt":"2025-03-02T22:58:29","slug":"responsive-images-with-resolution-switching","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/","title":{"rendered":"Responsive Images with Resolution Switching"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Today we have different devices with different sizes and orientations, and sending images that have been designed to look good on larger screens to users with considerably smaller low-resolution screens isn\u2019t suitable for performance. It can also create a poor user experience.<\/p>\n<p>In this jam, we\u2019ll learn how to use one of HTML\u2019s responsive image features &#8211;  resolution switching to make images responsive on devices with different screen sizes, thereby improving performance.<\/p>\n<h2>Resolution Switching<\/h2>\n<p>With resolution switching, We can provide the browser with additional information (viewport width, <a href=\"https:\/\/cloudinary.com\/glossary\/native-resolution\">resolution<\/a>, etc.), which it can use to display a different-sized copy of the same image based on the device.<\/p>\n<p>We\u2019ll use both the <code>srcset<\/code> and <code>size<\/code> attributes on the `img element to provide the browser with additional image assets to make the right choice.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">srcset<\/span>=<span class=\"hljs-string\">\"ifeoma-imoh-500w.jpg 500w,\n                 ifeoma-imoh-800w.jpg 800w\"<\/span>\n         <span class=\"hljs-attr\">sizes<\/span>=<span class=\"hljs-string\">\"(max-width: 600px) 500px,\n                800px\"<\/span>\n         <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"ifeoma-imoh-800w.jpg\"<\/span>\n         <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"MYy profile picture\"<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p><strong>srcset<\/strong>\nUsing the <code>srcset<\/code> attribute, we allow the browser to choose by providing a list of images and widths in pixels separated by commas. Images are labeled with a <strong>width descriptor<\/strong> &#8211; <code>w<\/code> and not <code>px<\/code>.<\/p>\n<p><strong>sizes<\/strong>\nThe <code>sizes<\/code> attribute gives the browser some information about the page layout based on some media conditions(e.g., (max-width:400px)). The browser then determines which image to choose from the list provided in the srcset attribute when certain conditions are true. All we need to do is give it multiple comma-separated values. For example, in our code snippet above, we say that when the viewport width is 500px or less, the browser should load the image that is 500px wide.<\/p>\n<p>Manually creating multiple alternate versions of each image can be time-consuming if your website has many images, so let\u2019s explore how to automate this process using Cloudinary.<\/p>\n<h2>Cloudinary<\/h2>\n<p>Cloudinary provides us with <a href=\"https:\/\/cloudinary.com\/documentation\/image_transformations#overview\">dynamic URL transformations<\/a> that we can use to adjust our media assets easily. We will upload a high-resolution image to Cloudinary and deliver it in various sizes and qualities based on the device viewport width.<\/p>\n<p>First, you need to <a href=\"https:\/\/cloudinary.com\/\">create a Cloudinary account<\/a> if you do not have one already. After that, you should see your account details on your dashboard. Now <a href=\"https:\/\/cloudinary.com\/documentation\/media_library_upload_tutorial#overview\">upload<\/a> an image to your Media Library with a file name that can be easily remembered. This file name or image name is also referred to as the public ID for that image.<\/p>\n<pre><code>&lt;a href=&quot;https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/ifeoma.jpg&quot; target=&quot;_blank&quot;&gt;https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/ifeoma.jpg&lt;\/a&gt;\n<\/code><\/pre>\n<p>This is the URL for the image I uploaded, and all our transformation instructions will be added between the <code>\/upload<\/code> and the public ID &#8211; <code>ifeoma.jpg<\/code>. For more on transformation URL structure, <a href=\"https:\/\/cloudinary.com\/documentation\/image_transformations#transformation_url_structure\">see here<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/jesse-thisdot\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1633948430\/e-61325f69b4ddf000699b0fe3\/dzndtkznugc9vey4yjcx.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1600\" height=\"885\"\/><\/p>\n<p>I uploaded the full resolution version of this image to my Cloudinary media library, and its file size is 89kb.<\/p>\n<p>To optimize our image and deliver it with minimal file size alongside high visual quality, we are going to focus on these three things:<\/p>\n<ul>\n<li>Reducing the width of the image<\/li>\n<li>Reducing the quality of the image for smaller devices<\/li>\n<li>Automatic format selection<\/li>\n<\/ul>\n<h2>Optimize Image Width<\/h2>\n<p>We are going to handle resizing our images with Cloudinary\u2019s <a href=\"https:\/\/cloudinary.com\/documentation\/image_transformations#width_parameter\">width parameter<\/a>. Including this parameter sets the image to your desired width in pixels based on the value you specify.<\/p>\n<p>To scale our image down to a width of 500px, all we need to do is add <code>w_500<\/code> between the <code>upload\/<\/code> and the public ID.<\/p>\n<p><a href=\"https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/w_500\/ifeoma.jpg\" target=\"_blank\">https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/w_500\/ifeoma.jpg<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/jesse-thisdot\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1633948485\/e-61325f69b4ddf000699b0fe3\/tra4crja3l5xvb4xjvmj.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1600\" height=\"793\"\/><\/p>\n<p>Scaling the width of this image down to 500px now results in a file size of 39kb.<\/p>\n<h2>Optimize Image Quality<\/h2>\n<p>We can define the quality compression levels applied to our images with the quality parameter provided by Cloudinary. The quality parameter accepts values ranging from 1 (smallest file size possible) to 100 (best visual quality). The value we choose determines what we\u2019re willing to trade-off between visual quality and file size. In the URL below, I passed in 50.<\/p>\n<pre><code>&lt;a href=&quot;https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/q_50\/ifeoma.jpg&quot; target=&quot;_blank&quot;&gt;https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/q_50\/ifeoma.jpg&lt;\/a&gt;\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/jesse-thisdot\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1633948541\/e-61325f69b4ddf000699b0fe3\/enwkjrayyztfkeen0eto.png\" alt=\"\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1600\" height=\"732\"\/><\/p>\n<p>Reducing the quality of this image now results in a file size of 31kb, and the loss in visual quality isn\u2019t so much.<\/p>\n<h2>Automatic Format Selection<\/h2>\n<p>This is another way we can significantly reduce our file size and save bandwidth without sacrificing quality. Using Cloudinary, we can specify that we deliver the best image format based on the user\u2019s browser. Cloudinary has a <code>fetch_format<\/code> <code>(f_)<\/code> transformation parameter, which converts and delivers images in various formats. Using it is as easy as providing the desired format as a file extension of your image URL. For more details, see the <a href=\"https:\/\/cloudinary.com\/documentation\/image_transformations#automatic_format_selection\">automatic format selection documentation<\/a>.<\/p>\n<p>If you want to convert to the png version of the uploaded JPEG file, it is as simple as specifying the format as the file extension of the delivery URL<\/p>\n<pre><code>&lt;a href=&quot;https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/q_70,w_500\/ifeoma.png&quot; target=&quot;_blank&quot;&gt;https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/q_70,w_500\/ifeoma.png&lt;\/a&gt;\n<\/code><\/pre>\n<p>In our case here, we will be setting the <code>fetch_format<\/code> parameter to <code>auto<\/code> because we want to deliver images (as WebP, AVIF, or JPEG) based on the user\u2019s browser. Cloudinary will automatically detect which browser is requesting the image, and it will deliver it in the best format for that browser. If a browser does not support any optimized formats that <code>f_auto<\/code> returns, the image will be delivered in the file extension\u2019s format.<\/p>\n<p><a href=\"https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/f_auto,q_70,w_500\/ifeoma.jpg\" target=\"_blank\">https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/f_auto,q_70,w_500\/ifeoma.jpg<\/a><\/p>\n<p>We\u2019ve seen how to use Cloudinary\u2019s image transformations to resize and optimize our image. Let\u2019s put our transformed URLs in an <code>img<\/code> tag. Create a folder called <code>responsive-images<\/code> and inside it, create an <code>index.html<\/code> file. Add the following to your <code>index.html<\/code> file.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">    <span class=\"hljs-meta\">&lt;!DOCTYPE <span class=\"hljs-meta-keyword\">html<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">html<\/span> <span class=\"hljs-attr\">lang<\/span>=<span class=\"hljs-string\">\"en\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">head<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">charset<\/span>=<span class=\"hljs-string\">\"UTF-8\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">http-equiv<\/span>=<span class=\"hljs-string\">\"X-UA-Compatible\"<\/span> <span class=\"hljs-attr\">content<\/span>=<span class=\"hljs-string\">\"IE=edge\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"viewport\"<\/span> <span class=\"hljs-attr\">content<\/span>=<span class=\"hljs-string\">\"width=device-width, initial-scale=1.0\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">title<\/span>&gt;<\/span>Resolution Switching<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">title<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">head<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"color:rgb(126, 4, 116);text-align:center;\"<\/span>&gt;<\/span>Resolution Switching with srcset and sizes<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>  <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"\n            max-width: 800px;\n            margin: 0 auto;\n            padding: 30px 30px;\"<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"width: 100%;\"<\/span>\n            <span class=\"hljs-attr\">sizes<\/span>=<span class=\"hljs-string\">\"(max-width 500px) 500px, 1000px)\"<\/span>\n            <span class=\"hljs-attr\">srcset<\/span>=<span class=\"hljs-string\">\"https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/f_auto,q_70,w_500\/ifeoma.jpg 500w,\n            https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/f_auto,q_70,w_768\/ifeoma.jpg 768w,\n            https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/f_auto,q_70,w_1024\/ifeoma.jpg 1024w,\n            https:\/\/res.cloudinary.com\/ifeomaimoh\/image\/upload\/f_auto,q_70,w_3200\/ifeoma.jpg 3200w,\"<\/span>\n            <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/res.cloudinary.com\/ifromaimoh\/image\/upload\/f_auto,q_70,w_500\/ifeoma.jpg\"<\/span>\n            <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"My profile picture\"<\/span> \n            \/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">html<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We wrapped our <code>img<\/code>  element in a <code>div<\/code> whose <code>max-width<\/code> is set to <code>800px<\/code>. In viewports above that width, the div remains at 800px and centers itself. In our <code>srcset<\/code> attribute, we passed three resized and optimized Cloudinary URLs. Now, based on which media condition is true and which slot size is specified for that media query, the browser is intelligent enough to determine the width of the requesting device and then load the appropriately-sized image. Using the <code>src<\/code>  attribute, we\u2019re also specifying a fallback image for older browsers that don\u2019t understand what the <code>srcset<\/code> and <code>sizes<\/code> attributes are.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this article, we learned that using resolution switching is one way to solve the problem of delivering large image files to smaller screens. Because they assist the browser in determining which image to load, the srcset attribute must always be accompanied by the sizes attribute. We also saw how easy it is to use Cloudinary\u2019s image transformation URLs to resize, optimize and generate multiple image formats.<\/p>\n<p>Check out the demo on <a href=\"https:\/\/codesandbox.io\/s\/responsive-images-with-resolution-switching-spq9l\">CodeSandbox<\/a><\/p>\n<\/div>\n\n\n  <div class=\"wp-block-cloudinary-code-sandbox \">\n    <iframe\n      src=\"https:\/\/codesandbox.io\/embed\/responsive-images-with-resolution-switching-spq9l?theme=dark&amp;codemirror=1&amp;highlights=&amp;editorsize=50&amp;fontsize=14&amp;expanddevtools=0&amp;hidedevtools=0&amp;eslint=0&amp;forcerefresh=0&amp;hidenavigation=0&amp;initialpath=%2F&amp;module=&amp;moduleview=0&amp;previewwindow=&amp;view=&amp;runonclick=1\"\n      height=\"500\"\n      style=\"width: 100%;\"\n      title=\"responsive images with resolution switching\"\n      loading=\"lazy\"\n      allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\"\n      sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n    ><\/iframe>\n  <\/div>\n\n\n<div class=\"wp-block-cloudinary-markdown \"><p><strong>Resources you may find helpful:<\/strong><\/p>\n<ul>\n<li>\n<a href=\"https:\/\/cloudinary.com\/documentation\/image_transformations\">Cloudinary documentation on image transformations<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/cloudinary.com\/documentation\/responsive_images\">Cloudinary documentation on responsive images<\/a>\n<\/li>\n<li>\n<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/HTML\/Multimedia_and_embedding\/Responsive_images\">MDN documentation on resolution switching<\/a>\n<\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":27748,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[134,145,370,374,377,371],"class_list":["post-27747","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-guest-post","tag-html5","tag-image","tag-performance","tag-resizing","tag-under-review"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Responsive Images with Resolution Switching<\/title>\n<meta name=\"description\" content=\"In this jam, we&#039;ll learn how to use one of HTML&#039;s responsive image features - resolution switching to make images responsive across a range of device screens. We will be using Cloudinary to host, transform and generate different file formats and sizes of our image.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Responsive Images with Resolution Switching\" \/>\n<meta property=\"og:description\" content=\"In this jam, we&#039;ll learn how to use one of HTML&#039;s responsive image features - resolution switching to make images responsive across a range of device screens. We will be using Cloudinary to host, transform and generate different file formats and sizes of our image.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-22T16:59:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-02T22:58:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"6000\" \/>\n\t<meta property=\"og:image:height\" content=\"4000\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Responsive Images with Resolution Switching\",\"datePublished\":\"2021-10-22T16:59:43+00:00\",\"dateModified\":\"2025-03-02T22:58:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/\"},\"wordCount\":5,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA\",\"keywords\":[\"Guest Post\",\"HTML5\",\"Image\",\"Performance\",\"Resizing\",\"Under Review\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2021\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/\",\"name\":\"Responsive Images with Resolution Switching\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA\",\"datePublished\":\"2021-10-22T16:59:43+00:00\",\"dateModified\":\"2025-03-02T22:58:29+00:00\",\"description\":\"In this jam, we'll learn how to use one of HTML's responsive image features - resolution switching to make images responsive across a range of device screens. We will be using Cloudinary to host, transform and generate different file formats and sizes of our image.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA\",\"width\":6000,\"height\":4000},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Responsive Images with Resolution Switching\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Responsive Images with Resolution Switching","description":"In this jam, we'll learn how to use one of HTML's responsive image features - resolution switching to make images responsive across a range of device screens. We will be using Cloudinary to host, transform and generate different file formats and sizes of our image.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/","og_locale":"en_US","og_type":"article","og_title":"Responsive Images with Resolution Switching","og_description":"In this jam, we'll learn how to use one of HTML's responsive image features - resolution switching to make images responsive across a range of device screens. We will be using Cloudinary to host, transform and generate different file formats and sizes of our image.","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/","og_site_name":"Cloudinary Blog","article_published_time":"2021-10-22T16:59:43+00:00","article_modified_time":"2025-03-02T22:58:29+00:00","og_image":[{"width":6000,"height":4000,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/"},"author":{"name":"","@id":""},"headline":"Responsive Images with Resolution Switching","datePublished":"2021-10-22T16:59:43+00:00","dateModified":"2025-03-02T22:58:29+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/"},"wordCount":5,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA","keywords":["Guest Post","HTML5","Image","Performance","Resizing","Under Review"],"inLanguage":"en-US","copyrightYear":"2021","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/","name":"Responsive Images with Resolution Switching","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA","datePublished":"2021-10-22T16:59:43+00:00","dateModified":"2025-03-02T22:58:29+00:00","description":"In this jam, we'll learn how to use one of HTML's responsive image features - resolution switching to make images responsive across a range of device screens. We will be using Cloudinary to host, transform and generate different file formats and sizes of our image.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA","width":6000,"height":4000},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/responsive-images-with-resolution-switching\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Responsive Images with Resolution Switching"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681926365\/Web_Assets\/blog\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2\/467a229c84580e4ac71fd42475fb289448696eea-6000x4000-1_27748a6fc2.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=27747"}],"version-history":[{"count":3,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27747\/revisions"}],"predecessor-version":[{"id":37096,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/27747\/revisions\/37096"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/27748"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=27747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=27747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=27747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}