{"id":2309,"date":"2017-06-12T10:34:45","date_gmt":"2017-06-12T10:34:45","guid":{"rendered":"https:\/\/shortpixel.com/blog\/?p=2309"},"modified":"2018-01-08T13:43:43","modified_gmt":"2018-01-08T13:43:43","slug":"png-jpeg-dilemma","status":"publish","type":"post","link":"https:\/\/shortpixel.com\/blog\/png-jpeg-dilemma\/","title":{"rendered":"A simple rule for the PNG or JPEG dilemma"},"content":{"rendered":"<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-2377\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2017\/06\/patrick-tomasso-88398.jpg\" alt=\"PNG or JPEG\" width=\"600\" height=\"360\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/patrick-tomasso-88398.jpg 600w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/patrick-tomasso-88398-300x180.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/>PNG or JPEG? Some bloggers know the answer to this question, and some don\u2019t. The former are not necessarily better than the later, but knowing how to choose the correct image format gives you a competitive advantage.<\/p>\n<p>This article could have been one sentence long: PNG is for text, JPEG is for the rest, but let&#8217;s get into some details.<\/p>\n<p><!--more--><\/p>\n<p><strong>Pictures with text<\/strong><\/p>\n<p>We recommend you to use PNG format for pictures containing text or graphics\/drawings with fine details. Usually, JPEG images are blurrier, and the contours of the letters appear less sharp. The fine lines from graphics could be also altered.<\/p>\n<p>Let\u2019s see two examples of the same image in both formats:<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_2362\" aria-describedby=\"caption-attachment-2362\" style=\"width: 604px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-2362 size-full\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2017\/06\/image1.png\" alt=\"PNG or JPEG - Example 1\" width=\"604\" height=\"143\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image1.png 604w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image1-300x71.png 300w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><figcaption id=\"caption-attachment-2362\" class=\"wp-caption-text\">Image 1 size: 22.4 kB<\/figcaption><\/figure>\n<figure id=\"attachment_2361\" aria-describedby=\"caption-attachment-2361\" style=\"width: 604px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-2361 size-full\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2017\/06\/image1.jpg\" alt=\"PNG or JPEG - Example 1\" width=\"604\" height=\"143\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image1.jpg 604w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image1-300x71.jpg 300w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><figcaption id=\"caption-attachment-2361\" class=\"wp-caption-text\">Image 1 size: 70.2 kB<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>The first image is clearer, but the text from the second image is also readable. If you decide that the JPEG format is good enough for displaying images containing text, please check their sizes. You will be surprised to find that in these cases the JPEG images are bigger.\u00a0 Check the bellow table to see the size comparison for all images.<\/p>\n<p>Important: Use PNG for logos and t<span id=\"result_box\" class=\"short_text\" lang=\"en\"><span class=\"\">echnical drawings too! This advice is specially true for the logos with gradients.<br \/>\n<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Regular images<\/strong><\/p>\n<p>On the other hand, JPEG images are usually smaller and better for the web. In other cases than banners or images with a lot of text, using PNG images slows your website, and in the most of the situations there are not visible differences between these formats. We recommend you to use PNG only if the text within an image is not readable.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>PNG (351.4 kB)<br \/>\n<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-2360\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2017\/06\/image2-2.png\" alt=\"PNG or JPEG - Example 2\" width=\"589\" height=\"391\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image2-2.png 589w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image2-1-300x199.png 300w\" sizes=\"(max-width: 589px) 100vw, 589px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>JPEG (153.2 kB)<br \/>\n<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-2359\" src=\"https:\/\/shortpixel.com/blog\/wp-content\/uploads\/2017\/06\/image2.jpg\" alt=\"PNG or JPEG - Example 2\" width=\"589\" height=\"391\" title=\"\" srcset=\"https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image2.jpg 589w, https:\/\/shortpixel.com\/blog\/wp-content\/uploads\/2017\/06\/image2-300x199.jpg 300w\" sizes=\"(max-width: 589px) 100vw, 589px\" \/><\/p>\n<p>As you could see, there are not obvious reasons to use PNG in this case. JPEG format is just fine and it is smaller as you could see bellow.<\/p>\n<p>&nbsp;<\/p>\n<h4><strong>PNG vs JPEG size comparison <\/strong><\/h4>\n<p>We like <a href=\"https:\/\/wordpress.org\/plugins\/tablepress\/\" target=\"_blank\" rel=\"noopener noreferrer\">tables,<\/a> and we made a new one with the sizes for all above images and their optimized versions.<\/p>\n\n<table id=\"tablepress-26\" class=\"tablepress tablepress-id-26\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\"><strong>PNG<\/strong><\/th><th class=\"column-3\"><strong>JPEG<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr class=\"row-2\">\n\t<td class=\"column-1\">Image 1<br \/>\n(with text)<\/td><td class=\"column-2\"><strong><span style=\"color:green\">22.4 kB<\/span><\/strong><\/td><td class=\"column-3\">70.2 kB<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\"><i>ShortPixel<br \/>\nOptimized<\/i><\/td><td class=\"column-2\"><strong><span style=\"color:green\">6 kB<\/span><\/strong><\/td><td class=\"column-3\">25 kB<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">Image 2<br \/>\n(without text)<\/td><td class=\"column-2\">351.4 kB<\/td><td class=\"column-3\"><strong><span style=\"color:green\">153.2 kB<\/span><\/strong><\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\"><i>ShortPixel<br \/>\nOptimized<\/i><\/td><td class=\"column-2\">103 kB<\/td><td class=\"column-3\"><strong><span style=\"color:green\">44 kB<\/span><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-26 from cache -->\n<p>As you could see, PNG is the best format for images with text not only because it has a better picture quality, but it also produces files with smaller sizes. If your images don&#8217;t contain mostly text, then go with JPEG format.<\/p>\n<p>If you are interested in image optimization tips and tools, give a try to <a href=\"https:\/\/wordpress.org\/plugins\/shortpixel-image-optimiser\/\" target=\"_blank\" rel=\"noopener\">ShortPixel image optimizer<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><em>Image credits: <a href=\"https:\/\/unsplash.com\/@alienowicz\" target=\"_blank\" rel=\"noopener noreferrer\">Artur Rutkowski<\/a>, and <a href=\"https:\/\/unsplash.com\/@impatrickt\" target=\"_blank\" rel=\"noopener\">Patrick Tomasso<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PNG or JPEG? Some bloggers know the answer to this question, and some don\u2019t. The former are not necessarily better than the later, but knowing how to choose the correct image format gives you a competitive advantage. This article could have been one sentence long: PNG is for text, JPEG is for the rest, but [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-2309","post","type-post","status-publish","format-standard","hentry","category-image-optimization"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/2309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/comments?post=2309"}],"version-history":[{"count":28,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/2309\/revisions"}],"predecessor-version":[{"id":2555,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/posts\/2309\/revisions\/2555"}],"wp:attachment":[{"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/media?parent=2309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/categories?post=2309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shortpixel.com\/blog\/wp-json\/wp\/v2\/tags?post=2309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}