{"id":1386,"date":"2012-06-30T12:05:47","date_gmt":"2012-06-30T19:05:47","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=1386"},"modified":"2012-07-03T08:01:05","modified_gmt":"2012-07-03T15:01:05","slug":"jpeg-image-compression","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=1386","title":{"rendered":"JPEG Image Compression"},"content":{"rendered":"<p>We\u2019ve made a bunch of games for iPads and based on reading the docs made all of our images PNGs. But that resulted in huge file sizes, especially for games that use photos. So we switched to JPEGs for the content. Buttons are still PNGs.<\/p>\n<p>In our first batch of games we used PhotoShop at 30% quality setting. The pictures are OK looking but you can see some artifacts, especially when there are large areas of the same color, like skies. For our current game, we experimented with <a href=\"http:\/\/imageoptim.com\/\">ImageOptim<\/a>. The new images are virtually indistinguishable from the originals. This is significantly smaller than Photoshop\u2014but not as small as you can get with a lower quality setting in Photoshop. Since there are no sounds in this game, we&#8217;ll probably go with ImageOptim.<\/p>\n<p>Here are some stats for 3673 pictures at 644&#215;498.<\/p>\n<p><pre><code class=\"preserve-code-formatting\">\nOriginals:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,140.0 MB \nImageOptim 80%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 249.6 MB\nImageOptim 2nd Pass&nbsp;&nbsp;238.9 MB\n\nPhotoshop 80%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;323.9 MB\nPhotoshop 50%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;249.8 MB\n50% with ImageOptim&nbsp;&nbsp;241.3 MB\n50% with 2x IO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 241.0 MB\nPhotoshop 30%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;166.7 MB\n<\/code><\/pre><\/p>\n<p>ImageOptim only has an 80% setting and running two passes gets you as small as you are going to get. I think, but can\u2019t verify, that IgageOptim on JPEGs doesn\u2019t do any compression <i>per se<\/i>. It just strips out and cleans up overhead and doesn&#8217;t affect the image quality. In other words, it\u2019s lossless compression. <\/p>\n<p>UPDATE: I tried this on a bunch of PNGs and got less dramatic, but still significant, results.<\/p>\n<p><pre><code class=\"preserve-code-formatting\">\n438 Images: 98.9 MB --&gt; 81.5 MB = 18%\n 68 Images: 19.3 MB ==&gt; 15.8 MB = 18%\n<\/code><\/pre><\/p>\n<p>I also compressed a file with a mix of JPEGs, PNGs, and PDFs.<\/p>\n<p><pre><code class=\"preserve-code-formatting\">\n145 Images: 65.9 --&gt; 38.8 MB = 39%\n<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019ve made a bunch of games for iPads and based on reading the docs made all of our images PNGs. But that resulted in huge file sizes, especially for games that use photos. So we switched to JPEGs for the content. Buttons are still PNGs. In our first batch of games we used PhotoShop at &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=1386\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">JPEG Image Compression<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1386","post","type-post","status-publish","format-standard","hentry","category-graphics"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1386"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1386\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}