{"id":21340,"date":"2015-12-22T14:50:02","date_gmt":"2015-12-22T14:50:02","guid":{"rendered":"http:\/\/responsive_images_with_srcset_sizes_and_cloudinary"},"modified":"2025-11-06T15:46:36","modified_gmt":"2025-11-06T23:46:36","slug":"responsive_images_with_srcset_sizes_and_cloudinary","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary","title":{"rendered":"Responsive Images: The `sizes` and `srcset` HTML Image Attributes"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Five years ago, Ethan Marcotte [coined the term \u201cresponsive web design\u201d][rwd] and gave it three defining ingredients: fluid grids, flexible media, and media queries.<\/p>\n<p>An essential part of this flexible media is the use of the <code>srcset img<\/code> attribute in HTML, which plays a crucial role in creating responsive images. The <code>srcset<\/code> attribute, used within the <code>&lt;img&gt;<\/code> or <code>&lt;source&gt;<\/code> tags, allows authors to define various image resources along with \u201chints\u201d that help the browser determine the most appropriate image source to display based on the resolution and screen size.<\/p>\n<p>For instance, using <code>srcset<\/code> with descriptors like \u201c2x\u201d and \u201c1x\u201d, as in <code>&lt;source srcset=&quot;square-large.jpg 2x, square-small.jpg 1x&quot; \/&gt;<\/code>, informs the browser about which image to use for different pixel densities. This setup is particularly beneficial for high-resolution screens, where a \u201c2x\u201d image can provide a crisper and more detailed display.<\/p>\n<p>This attribute has simplified responsive image sizing, allowing for a more intuitive and efficient process of specifying different image versions for varying display scenarios.<\/p>\n<p>That second ingredient, \u201cflexible media\u201d turned out to be a bit of a bugbear.<\/p>\n<p>This is part of a series of articles about <a href=\"https:\/\/cloudinary.com\/guides\/responsive-images\/what-are-responsive-images-and-6-useful-techniques\">Responsive Images<\/a>.<\/p>\n<p>You see, most of the media on the web is bitmap images. Heck, measured by bytes, [most of the web is bitmap images][http-archive]. And bitmap images are fixed. They have a fixed height and a fixed width, and while it\u2019s possible to make them <em>visually<\/em> grow and shrink using <code>width<\/code> and <code>max-width<\/code> CSS declarations, forcing users on small, low-resolution displays to load enormous images which have been sized to look good on high-resolution displays is a performance disaster. Every time we send a user more pixels than their device can use, we\u2019re asking them to load data which they\u2019ll end up throwing away. We\u2019re sending them <em>waste<\/em>.<\/p>\n<p>How much waste? Tim Kadlec has estimated that \u2014 for users on low-res mobile devices \u2014 72% of image bytes served up by responsive pages are wasted. <a href=\"https:\/\/cloudinary.com\/blog\/make_all_images_on_your_website_responsive_in_3_easy_steps\">Responsive<\/a> pages are sending small-screened users nearly <em>four times<\/em> as much data as they need.<\/p>\n<p>New markup is here to save the day. We can\u2019t include a single image resource that\u2019ll work for everybody, but by using new responsive image features, we <em>can<\/em> stuff multiple resources into a single <code>&lt;img&gt;<\/code> and mark them up in such a way that browsers will load the most appropriate resource out of the set. We <em>can<\/em> mark up image elements which have the ability to <em>adapt<\/em>.<\/p>\n<p>Let\u2019s dive in with an example: a news-y article page with a single, large-ish image up top:<\/p>\n<p><strong><a href=\"https:\/\/ericportis.com\/etc\/cloudinary\/castro-on-the-line\/\">https:\/\/ericportis.com\/etc\/cloudinary\/castro-on-the-line\/<\/a><\/strong><\/p>\n<video controls autoplay loop poster=\"https:\/\/res.cloudinary.com\/eeeps\/video\/upload\/w_770\/castro-flow.jpg\">\n\t<source src=\"https:\/\/res.cloudinary.com\/eeeps\/video\/upload\/w_770\/castro-flow.mp4\" type=\"video\/mp4\" \/>\n\t<source src=\"https:\/\/res.cloudinary.com\/eeeps\/video\/upload\/w_770\/castro-flow.webm\" type=\"video\/webm\" \/>\n\tThe image flowing across its max-width\n<\/video>\n<h2>Responsification With <code>sizes<\/code> and <code>srcset<\/code> HTML<\/h2>\n<h3><code>srcset img<\/code><\/h3>\n<p>How can we make this image responsive? The first tool in our belt is an <code>&lt;img&gt;<\/code> attribute named <code>srcset<\/code>. <code>srcset<\/code> allows us to stuff multiple resources into a single <code>&lt;img&gt;<\/code>, via a comma separated list:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    srcset=<span class=\"hljs-string\">\"large.jpg 1024w, medium.jpg 512w, small.jpg 256w\"<\/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\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We label each resource with a \u201cwidth descriptor\u201d \u2014 those numbers with <code>'w'<\/code>s after them, above. These let the browser know how wide each resource is. If a resource is 1024 pixels wide, stick a <code>1024w<\/code> after it in <code>srcset<\/code>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/image\/upload\/w_400,c_fill,f_auto,q_auto\/Web_Assets\/blog\/on_the_phone.jpg\" alt=\"Image of Barak Obama in the Oval Office used in the srcset HTML and srcset img attributes for responsive images with Cloudinary\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"400\" height=\"267\"\/><\/p>\n<p>Browsers will load the resource that best matches the current context. So, if the image is 512<code>px<\/code> wide on the layout, users on standard screens will probably get <code>medium.jpg<\/code>, and users on HiDPI display will probably get <code>large.jpg<\/code>.<\/p>\n<p>Why \u201cprobably?\u201d Ultimately, <em>browsers<\/em> decide which users get which resources. And we, as authors, can\u2019t necessarily predict which sorts of users will get what. This is a good thing! Browsers know a lot more about their context than we do. They have a wealth of information about each user\u2019s device, connection, and preferences and the pick-as-you-please philosophy of <code>srcset<\/code> lets them leverage it.<\/p>\n<p>So, let\u2019s add a <code>srcset<\/code> attribute to an <code>&lt;img&gt;<\/code>:<\/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-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">srcset<\/span>=<span class=\"hljs-string\">\"small.jpg 256w,\n                 medium.jpg 512w,\n                 large.jpg 1024w\"<\/span>\n         <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"medium.jpg\"<\/span>\n         <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"It\u2019s responsive!\"<\/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>Unfortunately, that won\u2019t quite cut it. When browsers encounter our <code>srcset<\/code>, they\u2019re missing a crucial piece of information: the <code>&lt;img&gt;<\/code>\u2018s layout width. In order to know an image\u2019s display dimensions, browsers have to load and parse all of its page\u2019s CSS \u2013 something which usually happens long after <code>srcset<\/code>-parsing. To cope, we need to give the browser an estimate of the layout width of the image right in our markup, using a new attribute: <code>sizes<\/code>.<\/p>\n<h3><code>sizes<\/code> HTML Tag<\/h3>\n<p><code>sizes<\/code> takes CSS lengths. If our <code>&lt;img&gt;<\/code> had a fixed width, we could simply stick that width in a <code>sizes<\/code> and call it a day. For instance \u2013 if it was always 640<code>px<\/code> across on the layout, our <code>sizes<\/code> would look like this:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    sizes=<span class=\"hljs-string\">\"640px\"<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Our example image is a little more complicated. Below its max width of <code>30em<\/code>, it occupies the full width of the viewport: <code>100vw<\/code>. Above that max-width, it will always be <code>30em<\/code> wide (<a href=\"http:\/\/www.w3schools.com\/cssref\/css_units.asp\">learn about \u2018em\u2019 and \u2018vw\u2019 CSS units<\/a>)<\/p>\n<video controls autoplay loop poster=\"https:\/\/res.cloudinary.com\/eeeps\/video\/upload\/w_770\/max-width.jpg\">\n\t<source src=\"https:\/\/res.cloudinary.com\/eeeps\/video\/upload\/w_770\/max-width.mp4\" type=\"video\/mp4\" \/>\n\t<source src=\"https:\/\/res.cloudinary.com\/eeeps\/video\/upload\/w_770\/max-width.webm\" type=\"video\/webm\" \/>\n\tHero image cropping and shortening at breakpoints\n<\/video>\n<p>So our image has two possible sizes. Luckily, just like <code>srcset<\/code>, <code>sizes<\/code> lets us supply multiple values in a comma-separated list. And it lets us tell the browser which lengths to use, when, using media queries. So to give the browser a complete picture of our <code>&lt;img&gt;<\/code>\u2019s dynamic layout width, we can mark it up with the following:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    sizes=<span class=\"hljs-string\">\"(min-width: 30em) 30em, 100vw\"<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>That says, if the viewport is at least <code>30em<\/code> wide, this image will be <code>30em<\/code> wide<sup>[1]<\/sup>. Otherwise, the image will be <code>100vw<\/code> wide.<\/p>\n<p>Putting all of the pieces together, we arrive at the following markup:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" 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\">\"small.jpg 256w,\n                 medium.jpg 512w,\n                 large.jpg 1024w\"<\/span>\n         <span class=\"hljs-attr\">sizes<\/span>=<span class=\"hljs-string\">\"(max-width: 30em) 30em, 100vw\"<\/span>\n         <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"medium.jpg\"<\/span>\n         <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\">\"It\u2019s responsive!\"<\/span> \/&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><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>This gives us a fluid, <a href=\"https:\/\/cloudinary.com\/glossary\/adaptive-images\">adaptable image<\/a>, which will look crisp on large, hi-res displays <em>and<\/em> minimize the number of wasted image bytes sent to users on low-res devices<sup>[2]<\/sup>.<\/p>\n<p>But! Now we, as authors, have a new problem: creating and managing three resources instead of just one.<\/p>\n<p>Rendering small, medium, and large versions for our single-image example is a minor inconvenience. But when multiplied by a whole page\u2019s worth of images, this extra work becomes a real burden. Asking poor, mistake-prone humans to render multiple versions of images at specific sizes very carefully and entirely by hand is both cruel and foolish. We need to automate.<\/p>\n<h2>Cloudification<\/h2>\n<p>Using Cloudinary, we can upload a single, canonical, high-resolution image to the cloud and deliver it in as many different sizes as we want via URL parameters (or Cloudinary\u2019s various SDKs). Controlling our images\u2019 technical characteristics via text and code has enormous benefits:<\/p>\n<ul>\n<li>Image characteristics are easy to author, see, and alter, right from the markup<\/li>\n<li>We can encode these characteristics directly in markup templates<\/li>\n<li>We can track changes to these characteristics using version control<\/li>\n<\/ul>\n<p>Using Cloudinary, adding a new image size (or changing an old one) on a site with thousands of images is as easy as changing a few lines in a template file. And content authors only have to worry about creating and uploading the highest-resolution image that they have; the nitty-gritty details of how that image will be variously compressed, sized, and served to users are handled automatically.<\/p>\n<p>So let\u2019s re-visit our example. And this time let\u2019s not simply assume that we have multiple down-sized versions of our image readily at hand \u2014 let\u2019s generate those resources with Cloudinary.<\/p>\n<p>After creating a <a href=\"https:\/\/cloudinary.com\/users\/register_free\">free Cloudinary account<\/a> I uploaded the full-res (1.2MB!) version of the example image to my Media Library and gave it an easy-to-remember name: <code>on_the_phone<\/code>. Once uploaded, I can access it using the following URL.<\/p>\n<p><cld-code-widget\n      class=\" c-code-widget\"\n      snippets=\"[{&quot;sdkId&quot;:&quot;nodejs&quot;,&quot;framework&quot;:&quot;nodejs&quot;,&quot;language&quot;:&quot;nodejs&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Node.js&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_2&quot;,&quot;framework&quot;:&quot;react_2&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;react&quot;,&quot;framework&quot;:&quot;react&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;\\\/Image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\n&lt;\\\/Image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;cloudinary-react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue_2&quot;,&quot;framework&quot;:&quot;vue_2&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/vue&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue&quot;,&quot;framework&quot;:&quot;vue&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;\\\/cld-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\n&lt;\\\/cld-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;cloudinary-vue&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular_2&quot;,&quot;framework&quot;:&quot;angular_2&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/ng&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular&quot;,&quot;framework&quot;:&quot;angular&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;\\\/cl-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\n&lt;\\\/cl-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/angular-5.x&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js_2&quot;,&quot;framework&quot;:&quot;js_2&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js&quot;,&quot;framework&quot;:&quot;js&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;).toHtml();&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;).toHtml();&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;cloudinary-core&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;python&quot;,&quot;framework&quot;:&quot;python&quot;,&quot;language&quot;:&quot;python&quot;,&quot;rawCodeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image()&quot;,&quot;codeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image()&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Python&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;php_2&quot;,&quot;framework&quot;:&quot;php_2&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;));&quot;,&quot;codeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;php&quot;,&quot;framework&quot;:&quot;php&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;java&quot;,&quot;framework&quot;:&quot;java&quot;,&quot;language&quot;:&quot;java&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Java&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;ruby&quot;,&quot;framework&quot;:&quot;ruby&quot;,&quot;language&quot;:&quot;ruby&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Ruby&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;csharp&quot;,&quot;framework&quot;:&quot;csharp&quot;,&quot;language&quot;:&quot;csharp&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;.NET&quot;,&quot;packageName&quot;:&quot;CloudinaryDotNet&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;dart&quot;,&quot;framework&quot;:&quot;dart&quot;,&quot;language&quot;:&quot;dart&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation());&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation());&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Dart&quot;,&quot;packageName&quot;:&quot;cloudinary_dart&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;swift&quot;,&quot;framework&quot;:&quot;swift&quot;,&quot;language&quot;:&quot;swift&quot;,&quot;rawCodeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;codeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;iOS&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;5.x&quot;},{&quot;sdkId&quot;:&quot;android&quot;,&quot;framework&quot;:&quot;android&quot;,&quot;language&quot;:&quot;android&quot;,&quot;rawCodeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Android&quot;,&quot;packageName&quot;:&quot;cloudinary-android&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;flutter&quot;,&quot;framework&quot;:&quot;flutter&quot;,&quot;language&quot;:&quot;flutter&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation());&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation());&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Flutter&quot;,&quot;packageName&quot;:&quot;cloudinary_flutter&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;kotlin&quot;,&quot;framework&quot;:&quot;kotlin&quot;,&quot;language&quot;:&quot;kotlin&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;) \\n}.generate()&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;) \\n}.generate()&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Kotlin&quot;,&quot;packageName&quot;:&quot;kotlin-url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;jquery&quot;,&quot;framework&quot;:&quot;jquery&quot;,&quot;language&quot;:&quot;jquery&quot;,&quot;rawCodeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;jQuery&quot;,&quot;packageName&quot;:&quot;cloudinary-jquery&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_native&quot;,&quot;framework&quot;:&quot;react_native&quot;,&quot;language&quot;:&quot;react_native&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React Native&quot;,&quot;packageName&quot;:&quot;cloudinary-react-native&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;}]\"\n      parsed-url=\"{&quot;url&quot;:&quot;https:\\\/\\\/res.cloudinary.com\\\/eeeps\\\/image\\\/upload\\\/on_the_phone.jpg&quot;,&quot;cloud_name&quot;:&quot;eeeps&quot;,&quot;host&quot;:&quot;res.cloudinary.com&quot;,&quot;type&quot;:&quot;upload&quot;,&quot;resource_type&quot;:&quot;image&quot;,&quot;transformation&quot;:[],&quot;transformation_string&quot;:&quot;&quot;,&quot;url_suffix&quot;:&quot;&quot;,&quot;version&quot;:&quot;&quot;,&quot;secure&quot;:true,&quot;public_id&quot;:&quot;on_the_phone.jpg&quot;,&quot;extension&quot;:&quot;jpg&quot;,&quot;format&quot;:&quot;jpg&quot;,&quot;format_code&quot;:true,&quot;url_code&quot;:false,&quot;signature&quot;:&quot;&quot;,&quot;private_cdn&quot;:false,&quot;result_asset_type&quot;:&quot;image&quot;}\"\n      with-url=\"true\"\n    >\n      <span class=\"u-visually-hidden\">Loading code examples<\/span>\n    <\/cld-code-widget><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/w_400\/on_the_phone.jpg\" alt=\"Image of Barak Obama in the Oval Office used in the srcset HTML and srcset img attributes for responsive images with Cloudinary added to the Media Library\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"400\" height=\"267\"\/><\/p>\n<p>Let\u2019s break this URL down:<\/p>\n<ul>\n<li>\n<code>res.cloudinary.com\/<\/code>: the base Cloudinary URL<\/li>\n<li>\n<code>eeeps<\/code>: my Cloudinary <a href=\"https:\/\/cloudinary.com\/documentation\/solution_overview#account_and_api_setup\">cloud name<\/a>\n<\/li>\n<li>\n<code>image\/upload\/<\/code>: the path to images uploaded to my media library<\/li>\n<li>\n<code>on-the-phone<\/code> the name of the image we\u2019d like to access<\/li>\n<li>\n<code>.jpg<\/code>: the desired format. We could just as easily request a <code>.png<\/code> or <code>.gif<\/code> here; even though the original, uploaded image is a JPEG, Cloudinary will do the conversion on the fly.<\/li>\n<\/ul>\n<p>All of the resizing action is going to happen between the <code>upload\/<\/code> and the image name. This is where [image transformations][transforms] go \u2014 the bits that are going to let us control exactly how our image is compressed, shaped, and sized for delivery<sup>[3]<\/sup>.<\/p>\n<p>The first thing that we\u2019re going to want to do to this image is scale it down. To do that, we\u2019ll use Cloudinary\u2019s [width parameter][w]. Stick a <code>w_<\/code> and a number into our URL, and Cloudinary will give us our image scaled to that many pixels across.<\/p>\n<p><cld-code-widget\n      class=\" c-code-widget\"\n      snippets=\"[{&quot;sdkId&quot;:&quot;nodejs&quot;,&quot;framework&quot;:&quot;nodejs&quot;,&quot;language&quot;:&quot;nodejs&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Node.js&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_2&quot;,&quot;framework&quot;:&quot;react_2&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;react&quot;,&quot;framework&quot;:&quot;react&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;Transformation width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt; &lt;\\\/Image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;Transformation width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt;\\n&lt;\\\/Image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;cloudinary-react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue_2&quot;,&quot;framework&quot;:&quot;vue_2&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/vue&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue&quot;,&quot;framework&quot;:&quot;vue&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;cld-transformation width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt; &lt;\\\/cld-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;cld-transformation width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt;\\n&lt;\\\/cld-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;cloudinary-vue&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular_2&quot;,&quot;framework&quot;:&quot;angular_2&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/ng&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular&quot;,&quot;framework&quot;:&quot;angular&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;cl-transformation width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot;&gt; &lt;\\\/cl-transformation&gt; &lt;\\\/cl-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;cl-transformation width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot;&gt;\\n\\t&lt;\\\/cl-transformation&gt;\\n&lt;\\\/cl-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/angular-5.x&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js_2&quot;,&quot;framework&quot;:&quot;js_2&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js&quot;,&quot;framework&quot;:&quot;js&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;, {width: 512, crop: \\&quot;scale\\&quot;}).toHtml();&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;, {width: 512, crop: \\&quot;scale\\&quot;}).toHtml();&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;cloudinary-core&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;python&quot;,&quot;framework&quot;:&quot;python&quot;,&quot;language&quot;:&quot;python&quot;,&quot;rawCodeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image(width=512, crop=\\&quot;scale\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image(width=512, crop=\\&quot;scale\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Python&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;php_2&quot;,&quot;framework&quot;:&quot;php_2&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;))\\n\\t-&gt;resize(Resize::scale()-&gt;width(512));&quot;,&quot;codeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;))\\n\\t-&gt;resize(Resize::scale()-&gt;width(512));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;php&quot;,&quot;framework&quot;:&quot;php&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, array(\\&quot;width\\&quot;=&gt;512, \\&quot;crop\\&quot;=&gt;\\&quot;scale\\&quot;))&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, array(\\&quot;width\\&quot;=&gt;512, \\&quot;crop\\&quot;=&gt;\\&quot;scale\\&quot;))&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;java&quot;,&quot;framework&quot;:&quot;java&quot;,&quot;language&quot;:&quot;java&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().width(512).crop(\\&quot;scale\\&quot;)).imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().width(512).crop(\\&quot;scale\\&quot;)).imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Java&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;ruby&quot;,&quot;framework&quot;:&quot;ruby&quot;,&quot;language&quot;:&quot;ruby&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, width: 512, crop: \\&quot;scale\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, width: 512, crop: \\&quot;scale\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Ruby&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;csharp&quot;,&quot;framework&quot;:&quot;csharp&quot;,&quot;language&quot;:&quot;csharp&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(512).Crop(\\&quot;scale\\&quot;)).BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(512).Crop(\\&quot;scale\\&quot;)).BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;.NET&quot;,&quot;packageName&quot;:&quot;CloudinaryDotNet&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;dart&quot;,&quot;framework&quot;:&quot;dart&quot;,&quot;language&quot;:&quot;dart&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512)));&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512)));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Dart&quot;,&quot;packageName&quot;:&quot;cloudinary_dart&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;swift&quot;,&quot;framework&quot;:&quot;swift&quot;,&quot;language&quot;:&quot;swift&quot;,&quot;rawCodeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setWidth(512).setCrop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;codeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setWidth(512).setCrop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;iOS&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;5.x&quot;},{&quot;sdkId&quot;:&quot;android&quot;,&quot;framework&quot;:&quot;android&quot;,&quot;language&quot;:&quot;android&quot;,&quot;rawCodeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().width(512).crop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().width(512).crop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Android&quot;,&quot;packageName&quot;:&quot;cloudinary-android&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;flutter&quot;,&quot;framework&quot;:&quot;flutter&quot;,&quot;language&quot;:&quot;flutter&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512)));&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512)));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Flutter&quot;,&quot;packageName&quot;:&quot;cloudinary_flutter&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;kotlin&quot;,&quot;framework&quot;:&quot;kotlin&quot;,&quot;language&quot;:&quot;kotlin&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;)\\n\\t resize(Resize.scale() { width(512) }) \\n}.generate()&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;)\\n\\t resize(Resize.scale() { width(512) }) \\n}.generate()&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Kotlin&quot;,&quot;packageName&quot;:&quot;kotlin-url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;jquery&quot;,&quot;framework&quot;:&quot;jquery&quot;,&quot;language&quot;:&quot;jquery&quot;,&quot;rawCodeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;codeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;jQuery&quot;,&quot;packageName&quot;:&quot;cloudinary-jquery&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_native&quot;,&quot;framework&quot;:&quot;react_native&quot;,&quot;language&quot;:&quot;react_native&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).resize(scale().width(512));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React Native&quot;,&quot;packageName&quot;:&quot;cloudinary-react-native&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;}]\"\n      parsed-url=\"{&quot;url&quot;:&quot;https:\\\/\\\/res.cloudinary.com\\\/eeeps\\\/image\\\/upload\\\/w_512\\\/on_the_phone.jpg&quot;,&quot;cloud_name&quot;:&quot;eeeps&quot;,&quot;host&quot;:&quot;res.cloudinary.com&quot;,&quot;type&quot;:&quot;upload&quot;,&quot;resource_type&quot;:&quot;image&quot;,&quot;transformation&quot;:[{&quot;width&quot;:&quot;512&quot;}],&quot;transformation_string&quot;:&quot;w_512&quot;,&quot;url_suffix&quot;:&quot;&quot;,&quot;version&quot;:&quot;&quot;,&quot;secure&quot;:true,&quot;public_id&quot;:&quot;on_the_phone.jpg&quot;,&quot;extension&quot;:&quot;jpg&quot;,&quot;format&quot;:&quot;jpg&quot;,&quot;format_code&quot;:true,&quot;url_code&quot;:false,&quot;signature&quot;:&quot;&quot;,&quot;private_cdn&quot;:false,&quot;result_asset_type&quot;:&quot;image&quot;}\"\n      with-url=\"true\"\n    >\n      <span class=\"u-visually-hidden\">Loading code examples<\/span>\n    <\/cld-code-widget><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/w_512\/on_the_phone.jpg\" alt=\"Image of Barak Obama in the Oval Office used in the srcset HTML and srcset img attributes for responsive images with Cloudinary using the width parameter\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"512\" height=\"341\"\/><\/p>\n<p>This scaled-down, 512-pixel-wide image weighs in at 86KB. How could we slim it down even further?<\/p>\n<p>Cloudinary\u2019s default compression settings are fairly conservative, resulting in heavy images of high quality. We can choose our own tradeoff \u2013 sacrificing a little quality for lighter images \u2013 using the [quality parameter][q]. The quality parameter takes a number between 0 and 100; after a little trial and error, I settled on 70.<\/p>\n<p><cld-code-widget\n      class=\" c-code-widget\"\n      snippets=\"[{&quot;sdkId&quot;:&quot;nodejs&quot;,&quot;framework&quot;:&quot;nodejs&quot;,&quot;language&quot;:&quot;nodejs&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Node.js&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_2&quot;,&quot;framework&quot;:&quot;react_2&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;react&quot;,&quot;framework&quot;:&quot;react&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;Transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt; &lt;\\\/Image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;Transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt;\\n&lt;\\\/Image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;cloudinary-react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue_2&quot;,&quot;framework&quot;:&quot;vue_2&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/vue&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue&quot;,&quot;framework&quot;:&quot;vue&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;cld-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt; &lt;\\\/cld-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;cld-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt;\\n&lt;\\\/cld-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;cloudinary-vue&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular_2&quot;,&quot;framework&quot;:&quot;angular_2&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/ng&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular&quot;,&quot;framework&quot;:&quot;angular&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;cl-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot;&gt; &lt;\\\/cl-transformation&gt; &lt;\\\/cl-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;cl-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; crop=\\&quot;scale\\&quot;&gt;\\n\\t&lt;\\\/cl-transformation&gt;\\n&lt;\\\/cl-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/angular-5.x&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js_2&quot;,&quot;framework&quot;:&quot;js_2&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js&quot;,&quot;framework&quot;:&quot;js&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;, {quality: 70, width: 512, crop: \\&quot;scale\\&quot;}).toHtml();&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;, {quality: 70, width: 512, crop: \\&quot;scale\\&quot;}).toHtml();&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;cloudinary-core&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;python&quot;,&quot;framework&quot;:&quot;python&quot;,&quot;language&quot;:&quot;python&quot;,&quot;rawCodeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image(quality=70, width=512, crop=\\&quot;scale\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image(quality=70, width=512, crop=\\&quot;scale\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Python&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;php_2&quot;,&quot;framework&quot;:&quot;php_2&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;))\\n\\t-&gt;resize(Resize::scale()-&gt;width(512))\\n\\t-&gt;delivery(Delivery::quality(70));&quot;,&quot;codeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;))\\n\\t-&gt;resize(Resize::scale()-&gt;width(512))\\n\\t-&gt;delivery(Delivery::quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;php&quot;,&quot;framework&quot;:&quot;php&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, array(\\&quot;quality\\&quot;=&gt;70, \\&quot;width\\&quot;=&gt;512, \\&quot;crop\\&quot;=&gt;\\&quot;scale\\&quot;))&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, array(\\&quot;quality\\&quot;=&gt;70, \\&quot;width\\&quot;=&gt;512, \\&quot;crop\\&quot;=&gt;\\&quot;scale\\&quot;))&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;java&quot;,&quot;framework&quot;:&quot;java&quot;,&quot;language&quot;:&quot;java&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().quality(70).width(512).crop(\\&quot;scale\\&quot;)).imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().quality(70).width(512).crop(\\&quot;scale\\&quot;)).imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Java&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;ruby&quot;,&quot;framework&quot;:&quot;ruby&quot;,&quot;language&quot;:&quot;ruby&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, quality: 70, width: 512, crop: \\&quot;scale\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, quality: 70, width: 512, crop: \\&quot;scale\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Ruby&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;csharp&quot;,&quot;framework&quot;:&quot;csharp&quot;,&quot;language&quot;:&quot;csharp&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.Transform(new Transformation().Quality(70).Width(512).Crop(\\&quot;scale\\&quot;)).BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.Transform(new Transformation().Quality(70).Width(512).Crop(\\&quot;scale\\&quot;)).BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;.NET&quot;,&quot;packageName&quot;:&quot;CloudinaryDotNet&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;dart&quot;,&quot;framework&quot;:&quot;dart&quot;,&quot;language&quot;:&quot;dart&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Dart&quot;,&quot;packageName&quot;:&quot;cloudinary_dart&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;swift&quot;,&quot;framework&quot;:&quot;swift&quot;,&quot;language&quot;:&quot;swift&quot;,&quot;rawCodeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setQuality(70).setWidth(512).setCrop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;codeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setQuality(70).setWidth(512).setCrop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;iOS&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;5.x&quot;},{&quot;sdkId&quot;:&quot;android&quot;,&quot;framework&quot;:&quot;android&quot;,&quot;language&quot;:&quot;android&quot;,&quot;rawCodeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().quality(70).width(512).crop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().quality(70).width(512).crop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Android&quot;,&quot;packageName&quot;:&quot;cloudinary-android&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;flutter&quot;,&quot;framework&quot;:&quot;flutter&quot;,&quot;language&quot;:&quot;flutter&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Flutter&quot;,&quot;packageName&quot;:&quot;cloudinary_flutter&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;kotlin&quot;,&quot;framework&quot;:&quot;kotlin&quot;,&quot;language&quot;:&quot;kotlin&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;)\\n\\t resize(Resize.scale() { width(512) })\\n\\t delivery(Delivery.quality(70)) \\n}.generate()&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;)\\n\\t resize(Resize.scale() { width(512) })\\n\\t delivery(Delivery.quality(70)) \\n}.generate()&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Kotlin&quot;,&quot;packageName&quot;:&quot;kotlin-url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;jquery&quot;,&quot;framework&quot;:&quot;jquery&quot;,&quot;language&quot;:&quot;jquery&quot;,&quot;rawCodeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;codeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, crop: \\&quot;scale\\&quot;})&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;jQuery&quot;,&quot;packageName&quot;:&quot;cloudinary-jquery&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_native&quot;,&quot;framework&quot;:&quot;react_native&quot;,&quot;language&quot;:&quot;react_native&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React Native&quot;,&quot;packageName&quot;:&quot;cloudinary-react-native&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;}]\"\n      parsed-url=\"{&quot;url&quot;:&quot;https:\\\/\\\/res.cloudinary.com\\\/eeeps\\\/image\\\/upload\\\/q_70,w_512\\\/on_the_phone.jpg&quot;,&quot;cloud_name&quot;:&quot;eeeps&quot;,&quot;host&quot;:&quot;res.cloudinary.com&quot;,&quot;type&quot;:&quot;upload&quot;,&quot;resource_type&quot;:&quot;image&quot;,&quot;transformation&quot;:[{&quot;quality&quot;:&quot;70&quot;,&quot;width&quot;:&quot;512&quot;}],&quot;transformation_string&quot;:&quot;q_70,w_512&quot;,&quot;url_suffix&quot;:&quot;&quot;,&quot;version&quot;:&quot;&quot;,&quot;secure&quot;:true,&quot;public_id&quot;:&quot;on_the_phone.jpg&quot;,&quot;extension&quot;:&quot;jpg&quot;,&quot;format&quot;:&quot;jpg&quot;,&quot;format_code&quot;:true,&quot;url_code&quot;:false,&quot;signature&quot;:&quot;&quot;,&quot;private_cdn&quot;:false,&quot;result_asset_type&quot;:&quot;image&quot;}\"\n      with-url=\"true\"\n    >\n      <span class=\"u-visually-hidden\">Loading code examples<\/span>\n    <\/cld-code-widget><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/q_70,w_512\/on_the_phone.jpg\" alt=\"Image of Barak Obama in the Oval Office used in the srcset HTML and srcset img attributes for responsive images with Cloudinary quality parameter set to 70\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"512\" height=\"341\"\/><\/p>\n<p>This results in an image that\u2019s 46KB \u2014 half the size of the un<code>q_<\/code>\u2018d version! What else could we do to cut weight? What if tried a different format entirely, like Google\u2019s relatively-new [WebP][webp] format?<\/p>\n<p><a href=\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/q_70,w_512\/on_the_phone.webp\" title=\"color_url: true, with_url: true, with_code: true\">WebP resized image of 70% quality<\/a><\/p>\n<p>That cuts the size of the image by more than a third again, bringing it down to 36KB. But Here\u2019s what that WebP looks like in anything but Chrome:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_400\/broken-image.jpg\" alt=\"Image of screenshot of WebP when shows up in non compatible browser used in the srcset HTML and srcset img attributes for responsive images with Cloudinary\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"400\" height=\"609\"\/><\/p>\n<p>That clearly won\u2019t do. How can we send new, advanced image formats to browsers that support them, without showing broken image icons to browsers that don\u2019t?<\/p>\n<p>There\u2019s a whole new markup pattern that\u2019s been spec\u2019d specifically to address this problem, but using Cloudinary, we don\u2019t need it. Just stick an <code>f_auto<\/code> parameter into an image URL, and Cloudinary will perform some server-side [content-negotiation][conneg] magic to ensure that every browser gets the latest and greatest format that it supports:<\/p>\n<p><cld-code-widget\n      class=\" c-code-widget\"\n      snippets=\"[{&quot;sdkId&quot;:&quot;nodejs&quot;,&quot;framework&quot;:&quot;nodejs&quot;,&quot;language&quot;:&quot;nodejs&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, fetch_format: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;})&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, fetch_format: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;})&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Node.js&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_2&quot;,&quot;framework&quot;:&quot;react_2&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;react&quot;,&quot;framework&quot;:&quot;react&quot;,&quot;language&quot;:&quot;react&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;Transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; fetchFormat=\\&quot;auto\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt; &lt;\\\/Image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;Image publicId=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;Transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; fetchFormat=\\&quot;auto\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt;\\n&lt;\\\/Image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React&quot;,&quot;packageName&quot;:&quot;cloudinary-react&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue_2&quot;,&quot;framework&quot;:&quot;vue_2&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/vue&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;vue&quot;,&quot;framework&quot;:&quot;vue&quot;,&quot;language&quot;:&quot;vue&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;cld-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; fetch-format=\\&quot;auto\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt; &lt;\\\/cld-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cld-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;cld-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; fetch-format=\\&quot;auto\\&quot; crop=\\&quot;scale\\&quot; \\\/&gt;\\n&lt;\\\/cld-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Vue.js&quot;,&quot;packageName&quot;:&quot;cloudinary-vue&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular_2&quot;,&quot;framework&quot;:&quot;angular_2&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/ng&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;angular&quot;,&quot;framework&quot;:&quot;angular&quot;,&quot;language&quot;:&quot;angular&quot;,&quot;rawCodeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt; &lt;cl-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; fetch-format=\\&quot;auto\\&quot; crop=\\&quot;scale\\&quot;&gt; &lt;\\\/cl-transformation&gt; &lt;\\\/cl-image&gt;&quot;,&quot;codeSnippet&quot;:&quot;&lt;cl-image public-id=\\&quot;on_the_phone.jpg\\&quot; &gt;\\n\\t&lt;cl-transformation quality=\\&quot;70\\&quot; width=\\&quot;512\\&quot; fetch-format=\\&quot;auto\\&quot; crop=\\&quot;scale\\&quot;&gt;\\n\\t&lt;\\\/cl-transformation&gt;\\n&lt;\\\/cl-image&gt;&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Angular&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/angular-5.x&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js_2&quot;,&quot;framework&quot;:&quot;js_2&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;@cloudinary\\\/url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;js&quot;,&quot;framework&quot;:&quot;js&quot;,&quot;language&quot;:&quot;js&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;, {quality: 70, width: 512, fetchFormat: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;}).toHtml();&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.imageTag(&#039;on_the_phone.jpg&#039;, {quality: 70, width: 512, fetchFormat: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;}).toHtml();&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;JS&quot;,&quot;packageName&quot;:&quot;cloudinary-core&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;python&quot;,&quot;framework&quot;:&quot;python&quot;,&quot;language&quot;:&quot;python&quot;,&quot;rawCodeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image(quality=70, width=512, fetch_format=\\&quot;auto\\&quot;, crop=\\&quot;scale\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;).image(quality=70, width=512, fetch_format=\\&quot;auto\\&quot;, crop=\\&quot;scale\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Python&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;php_2&quot;,&quot;framework&quot;:&quot;php_2&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;))\\n\\t-&gt;resize(Resize::scale()-&gt;width(512))\\n\\t-&gt;delivery(Delivery::format(\\n\\tFormat::auto()))\\n\\t-&gt;delivery(Delivery::quality(70));&quot;,&quot;codeSnippet&quot;:&quot;(new ImageTag(&#039;on_the_phone.jpg&#039;))\\n\\t-&gt;resize(Resize::scale()-&gt;width(512))\\n\\t-&gt;delivery(Delivery::format(\\n\\tFormat::auto()))\\n\\t-&gt;delivery(Delivery::quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;php&quot;,&quot;framework&quot;:&quot;php&quot;,&quot;language&quot;:&quot;php&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, array(\\&quot;quality\\&quot;=&gt;70, \\&quot;width\\&quot;=&gt;512, \\&quot;fetch_format\\&quot;=&gt;\\&quot;auto\\&quot;, \\&quot;crop\\&quot;=&gt;\\&quot;scale\\&quot;))&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, array(\\&quot;quality\\&quot;=&gt;70, \\&quot;width\\&quot;=&gt;512, \\&quot;fetch_format\\&quot;=&gt;\\&quot;auto\\&quot;, \\&quot;crop\\&quot;=&gt;\\&quot;scale\\&quot;))&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;PHP&quot;,&quot;packageName&quot;:&quot;cloudinary_php&quot;,&quot;packageStatus&quot;:&quot;legacy&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;java&quot;,&quot;framework&quot;:&quot;java&quot;,&quot;language&quot;:&quot;java&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().quality(70).width(512).fetchFormat(\\&quot;auto\\&quot;).crop(\\&quot;scale\\&quot;)).imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.url().transformation(new Transformation().quality(70).width(512).fetchFormat(\\&quot;auto\\&quot;).crop(\\&quot;scale\\&quot;)).imageTag(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Java&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;ruby&quot;,&quot;framework&quot;:&quot;ruby&quot;,&quot;language&quot;:&quot;ruby&quot;,&quot;rawCodeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, quality: 70, width: 512, fetch_format: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cl_image_tag(\\&quot;on_the_phone.jpg\\&quot;, quality: 70, width: 512, fetch_format: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Ruby&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;csharp&quot;,&quot;framework&quot;:&quot;csharp&quot;,&quot;language&quot;:&quot;csharp&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.Transform(new Transformation().Quality(70).Width(512).FetchFormat(\\&quot;auto\\&quot;).Crop(\\&quot;scale\\&quot;)).BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.Api.UrlImgUp.Transform(new Transformation().Quality(70).Width(512).FetchFormat(\\&quot;auto\\&quot;).Crop(\\&quot;scale\\&quot;)).BuildImageTag(\\&quot;on_the_phone.jpg\\&quot;)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;.NET&quot;,&quot;packageName&quot;:&quot;CloudinaryDotNet&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;dart&quot;,&quot;framework&quot;:&quot;dart&quot;,&quot;language&quot;:&quot;dart&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.format(\\n\\tFormat.auto()))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.format(\\n\\tFormat.auto()))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Dart&quot;,&quot;packageName&quot;:&quot;cloudinary_dart&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;swift&quot;,&quot;framework&quot;:&quot;swift&quot;,&quot;language&quot;:&quot;swift&quot;,&quot;rawCodeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setQuality(70).setWidth(512).setFetchFormat(\\&quot;auto\\&quot;).setCrop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;codeSnippet&quot;:&quot;imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setQuality(70).setWidth(512).setFetchFormat(\\&quot;auto\\&quot;).setCrop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;)!, cloudinary: cloudinary)&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;iOS&quot;,&quot;packageName&quot;:&quot;cloudinary&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;5.x&quot;},{&quot;sdkId&quot;:&quot;android&quot;,&quot;framework&quot;:&quot;android&quot;,&quot;language&quot;:&quot;android&quot;,&quot;rawCodeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().quality(70).width(512).fetchFormat(\\&quot;auto\\&quot;).crop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;codeSnippet&quot;:&quot;MediaManager.get().url().transformation(new Transformation().quality(70).width(512).fetchFormat(\\&quot;auto\\&quot;).crop(\\&quot;scale\\&quot;)).generate(\\&quot;on_the_phone.jpg\\&quot;);&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Android&quot;,&quot;packageName&quot;:&quot;cloudinary-android&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;3.x&quot;},{&quot;sdkId&quot;:&quot;flutter&quot;,&quot;framework&quot;:&quot;flutter&quot;,&quot;language&quot;:&quot;flutter&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.format(\\n\\tFormat.auto()))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image(&#039;on_the_phone.jpg&#039;).transformation(Transformation()\\n\\t.resize(Resize.scale().width(512))\\n\\t.delivery(Delivery.format(\\n\\tFormat.auto()))\\n\\t.delivery(Delivery.quality(70)));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Flutter&quot;,&quot;packageName&quot;:&quot;cloudinary_flutter&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;kotlin&quot;,&quot;framework&quot;:&quot;kotlin&quot;,&quot;language&quot;:&quot;kotlin&quot;,&quot;rawCodeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;)\\n\\t resize(Resize.scale() { width(512) })\\n\\t delivery(Delivery.format(\\n\\tFormat.auto()))\\n\\t delivery(Delivery.quality(70)) \\n}.generate()&quot;,&quot;codeSnippet&quot;:&quot;cloudinary.image {\\n\\tpublicId(\\&quot;on_the_phone.jpg\\&quot;)\\n\\t resize(Resize.scale() { width(512) })\\n\\t delivery(Delivery.format(\\n\\tFormat.auto()))\\n\\t delivery(Delivery.quality(70)) \\n}.generate()&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;Kotlin&quot;,&quot;packageName&quot;:&quot;kotlin-url-gen&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;},{&quot;sdkId&quot;:&quot;jquery&quot;,&quot;framework&quot;:&quot;jquery&quot;,&quot;language&quot;:&quot;jquery&quot;,&quot;rawCodeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, fetch_format: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;})&quot;,&quot;codeSnippet&quot;:&quot;$.cloudinary.image(\\&quot;on_the_phone.jpg\\&quot;, {quality: 70, width: 512, fetch_format: \\&quot;auto\\&quot;, crop: \\&quot;scale\\&quot;})&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;jQuery&quot;,&quot;packageName&quot;:&quot;cloudinary-jquery&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;2.x&quot;},{&quot;sdkId&quot;:&quot;react_native&quot;,&quot;framework&quot;:&quot;react_native&quot;,&quot;language&quot;:&quot;react_native&quot;,&quot;rawCodeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;codeSnippet&quot;:&quot;new CloudinaryImage(\\&quot;on_the_phone.jpg\\&quot;)\\n  .resize(scale().width(512))\\n  .delivery(format(auto()))\\n  .delivery(quality(70));&quot;,&quot;status&quot;:0,&quot;statusText&quot;:&quot;Ok&quot;,&quot;displayName&quot;:&quot;React Native&quot;,&quot;packageName&quot;:&quot;cloudinary-react-native&quot;,&quot;packageStatus&quot;:&quot;&quot;,&quot;packageVersion&quot;:&quot;1.x&quot;}]\"\n      parsed-url=\"{&quot;url&quot;:&quot;https:\\\/\\\/res.cloudinary.com\\\/eeeps\\\/image\\\/upload\\\/f_auto,q_70,w_512\\\/on_the_phone.jpg&quot;,&quot;cloud_name&quot;:&quot;eeeps&quot;,&quot;host&quot;:&quot;res.cloudinary.com&quot;,&quot;type&quot;:&quot;upload&quot;,&quot;resource_type&quot;:&quot;image&quot;,&quot;transformation&quot;:[{&quot;format&quot;:&quot;auto&quot;,&quot;quality&quot;:&quot;70&quot;,&quot;width&quot;:&quot;512&quot;}],&quot;transformation_string&quot;:&quot;f_auto,q_70,w_512&quot;,&quot;url_suffix&quot;:&quot;&quot;,&quot;version&quot;:&quot;&quot;,&quot;secure&quot;:true,&quot;public_id&quot;:&quot;on_the_phone.jpg&quot;,&quot;extension&quot;:&quot;jpg&quot;,&quot;format&quot;:&quot;jpg&quot;,&quot;format_code&quot;:true,&quot;url_code&quot;:false,&quot;signature&quot;:&quot;&quot;,&quot;private_cdn&quot;:false,&quot;result_asset_type&quot;:&quot;image&quot;}\"\n      with-url=\"true\"\n    >\n      <span class=\"u-visually-hidden\">Loading code examples<\/span>\n    <\/cld-code-widget><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_512\/on_the_phone.jpg\" alt=\"Image of Barak Obama in the Oval Office used in the srcset HTML and srcset img attributes for responsive images with Cloudinary using f_auto parameter\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"512\" height=\"341\"\/><\/p>\n<p>When accessing this URL, Chrome will get a WebP, Edge and IE 9+ will get a [JPEG-XR][jpeg-xr], and everybody else will get a JPEG.<\/p>\n<p>Okay \u2013 now that we know how to use Cloudinary\u2019s image transformations to generate resized (and optimized) versions of our original, let\u2019s stick some Cloudinary URLs into our responsive image markup:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" 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>\n    \t<span class=\"hljs-attr\">sizes<\/span>=<span class=\"hljs-string\">\"(min-width: 30em) 28em, 100vw\"<\/span>\n    \t<span class=\"hljs-attr\">srcset<\/span>=<span class=\"hljs-string\">\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_256\/on_the_phone.jpg 256w,\n    \t        https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_512\/on_the_phone.jpg 512w,\n    \t        https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_768\/on_the_phone.jpg 768w,\n    \t        https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_1024\/on_the_phone.jpg 1024w,\n    \t        https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_1280\/on_the_phone.jpg 1280w\"<\/span>\n    \t<span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_512\/on_the_phone.jpg\"<\/span>\n    \t<span class=\"hljs-attr\">alt<\/span> \/&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><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>That\u2019s the fully-responsive <code>&lt;img&gt;<\/code> as it appears on our [example page][castro-on-the-line].<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/eeeps\/image\/upload\/f_auto,q_70,w_770\/srcset-example-final.jpg\" alt=\"Image screenshot of example web page showing Barak Obama in the Oval Office used in the srcset HTML and srcset img attributes for responsive images with Cloudinary\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"770\" height=\"785\"\/><\/p>\n<p>This <code>&lt;img&gt;<\/code> will adapt right along with our responsive layout, serving a well-optimized version of our resource to users with differing viewport sizes, device resolutions, and browser-format-support capabilities.<\/p>\n<p>Even better, with this markup, we bring the number of image resources that we have to worry about creating and managing back down to one: the high-res original we upload to Cloudinary. And if we ever want to tweak how we\u2019re actually delivering that image to users, it\u2019s as simple as changing a few characters in our HTML.<\/p>\n<p><a href=\"https:\/\/cloudinary.com\/documentation\/responsive_images\">Responsive images<\/a> are here, and cloud-based image hosting makes them easy.<\/p>\n<p>Thus concludes part one of a two-part series. Next time, I\u2019ll show you how to pair <code>&lt;picture&gt;<\/code> with Cloudinary\u2019s cropping transforms to add another dimension of adaptability to our images: [art direction][art-direction]. Stay tuned!<\/p>\n<hr \/>\n<p><strong>[1]<\/strong>: Particularly sharp readers may notice a slight problem with this: <code>em<\/code> are relative, and <code>30em<\/code> in one context might not equal <code>30em<\/code> in another. Within the context of <code>sizes<\/code>, an <code>em<\/code> is always equal to the default font size (usually <code>16px<\/code>). But within the context of a CSS declaration, the size of an <code>em<\/code> is dependent on the <code>font-size<\/code> of the selected element. And indeed, our page\u2019s [viewport-sized typography][vw-type] means that the two <code>30em<\/code>s will almost never be precisely the same. But you know what? They\u2019re close enough! A precise <code>sizes<\/code> value would make our markup harder to read, understand, and maintain \u2013 and would only effect which source was chosen in a tiny number of cases. In horseshoes, hand grenades, <em>and<\/em> <code>sizes<\/code>: close counts.<\/p>\n<p><strong>[2]<\/strong>: How do browsers actually use <code>srcset<\/code> and <code>sizes<\/code> to pick a source? They divide the resource widths (the <code>w<\/code>s), by the current layout width (figured out via <code>sizes<\/code>) to calculate each resource\u2019s \u201cimage density\u201d. So, let\u2019s say our <code>sizes<\/code> evaluates to a layout width of <code>512px<\/code>, and we\u2019re working with a <code>srcset=&quot;small.jpg 256w, medium.jpg 512w, large.jpg 1024w&quot;<\/code>. The image densities would work out to:<\/p>\n<p><code>small.jpg<\/code>: <code>256w<\/code> resource width \u00f7 <code>512px<\/code> layout width = 0.5x image density\n<code>medium.jpg<\/code>: <code>512w<\/code> resource width \u00f7 <code>512px<\/code> layout width = 1x image density\n<code>large.jpg<\/code>: <code>1024w<\/code> resource width \u00f7 <code>512px<\/code> layout width = 2x image density<\/p>\n<p>Browsers make their decision based on these image densities. So users on 1x devices will <em>probably<\/em> get <code>medium.jpg<\/code>, users on Hi-DPI displays will <em>most likely<\/em> load <code>large.jpg<\/code>, and perhaps users on slow connections, or who\u2019ve set some sort of preference stating that they suffer from poor eyesight will get <code>small.jpg<\/code>. But again, there\u2019s no way for us, as authors, to know for certain which sorts of users will get what. In the browser we trust.<\/p>\n<p><strong>[3]<\/strong>: Cloudinary\u2019s <a href=\"https:\/\/cloudinary.com\/documentation\">SDK frameworks<\/a> give you language-specific tools to build these URLs indirectly. Check out the tabs in the examples to see how achieve each transformation using your framework of choice.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":21341,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[145,251],"class_list":["post-21340","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-html5","tag-responsive-images"],"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: The Sizes and srcset HTML Image Attributes<\/title>\n<meta name=\"description\" content=\"How-to mark up images using Cloudinary\u2019s image transformations and the srcset HTML responsive image attribute for free.\" \/>\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\/responsive_images_with_srcset_sizes_and_cloudinary\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Responsive Images: The `sizes` and `srcset` HTML Image Attributes\" \/>\n<meta property=\"og:description\" content=\"How-to mark up images using Cloudinary\u2019s image transformations and the srcset HTML responsive image attribute for free.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-22T14:50:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-06T23:46:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"1540\" \/>\n\t<meta property=\"og:image:height\" content=\"925\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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\/responsive_images_with_srcset_sizes_and_cloudinary#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Responsive Images: The `sizes` and `srcset` HTML Image Attributes\",\"datePublished\":\"2015-12-22T14:50:02+00:00\",\"dateModified\":\"2025-11-06T23:46:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary\"},\"wordCount\":9,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA\",\"keywords\":[\"HTML5\",\"Responsive Images\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2015\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary\",\"url\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary\",\"name\":\"Responsive Images: The Sizes and srcset HTML Image Attributes\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA\",\"datePublished\":\"2015-12-22T14:50:02+00:00\",\"dateModified\":\"2025-11-06T23:46:36+00:00\",\"description\":\"How-to mark up images using Cloudinary\u2019s image transformations and the srcset HTML responsive image attribute for free.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA\",\"width\":1540,\"height\":925,\"caption\":\"Image showing graphic representation of various computer screens and code showing srcset HTML and srcset img attributes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Responsive Images: The `sizes` and `srcset` HTML Image Attributes\"}]},{\"@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: The Sizes and srcset HTML Image Attributes","description":"How-to mark up images using Cloudinary\u2019s image transformations and the srcset HTML responsive image attribute for free.","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\/responsive_images_with_srcset_sizes_and_cloudinary","og_locale":"en_US","og_type":"article","og_title":"Responsive Images: The `sizes` and `srcset` HTML Image Attributes","og_description":"How-to mark up images using Cloudinary\u2019s image transformations and the srcset HTML responsive image attribute for free.","og_url":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary","og_site_name":"Cloudinary Blog","article_published_time":"2015-12-22T14:50:02+00:00","article_modified_time":"2025-11-06T23:46:36+00:00","og_image":[{"width":1540,"height":925,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA","type":"image\/png"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary"},"author":{"name":"","@id":""},"headline":"Responsive Images: The `sizes` and `srcset` HTML Image Attributes","datePublished":"2015-12-22T14:50:02+00:00","dateModified":"2025-11-06T23:46:36+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary"},"wordCount":9,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA","keywords":["HTML5","Responsive Images"],"inLanguage":"en-US","copyrightYear":"2015","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary","url":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary","name":"Responsive Images: The Sizes and srcset HTML Image Attributes","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA","datePublished":"2015-12-22T14:50:02+00:00","dateModified":"2025-11-06T23:46:36+00:00","description":"How-to mark up images using Cloudinary\u2019s image transformations and the srcset HTML responsive image attribute for free.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA","width":1540,"height":925,"caption":"Image showing graphic representation of various computer screens and code showing srcset HTML and srcset img attributes"},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/responsive_images_with_srcset_sizes_and_cloudinary#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Responsive Images: The `sizes` and `srcset` HTML Image Attributes"}]},{"@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\/v1649722087\/Web_Assets\/blog\/responsive_srcset_post\/responsive_srcset_post.png?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21340","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=21340"}],"version-history":[{"count":14,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21340\/revisions"}],"predecessor-version":[{"id":39137,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21340\/revisions\/39137"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/21341"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=21340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=21340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=21340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}