{"id":3196,"date":"2015-01-09T12:37:45","date_gmt":"2015-01-09T18:37:45","guid":{"rendered":"http:\/\/neosmart.net\/blog\/?p=3196"},"modified":"2015-01-09T12:37:45","modified_gmt":"2015-01-09T18:37:45","slug":"free-up-space-on-an-iphone-by-compressing-your-photo-album","status":"publish","type":"post","link":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/","title":{"rendered":"Free up space on an iPhone by compressing your photo album"},"content":{"rendered":"<p>Most people that have had iPhones for more than a year or two have accumulated a massive amount of photos, at least several gigabytes in size. With iPhones still only shipping with a puny 16 GiB of storage by default (unless you pony up the $100 for a huge jump to the 64 GiB model with the iPhone 6\/6+), Apple has been making a lot of money off of people looking to keep their photos and still have room to take more. But there&#8217;s another option: you can optimize and compress your existing photos to make them take up less space, and recover free space for your use.<\/p>\n<p>Using the right tools and depending on the nature of your photos and images, you&#8217;ll be able to recover anywhere from 5% to 20% of your photo album size with these instructions!<\/p>\n<p><!--more--><\/p>\n<p>Depending on the whether or not your iPhone is jailbroken, you&#8217;ll be able to carry out the instructions in either one or two passes. Note that there are a lot of various utilities and tools used below, you&#8217;ll need to obtain them by downloading from the respective websites, building from source, or using a package manager (apt, brew, yum, pkg, etc).<\/p>\n<p>Requirements:<\/p>\n<ul>\n<li><a href=\"http:\/\/fuse.sourceforge.net\/sshfs.html\" rel=\"follow\">sshfs<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mozilla\/mozjpeg\" rel=\"nofollow\">mozjpeg<\/a><\/li>\n<li><a href=\"http:\/\/pmt.sourceforge.net\/pngcrush\/\" rel=\"follow\">pngcrush<\/a><\/li>\n<li><a href=\"http:\/\/www.gnu.org\/software\/parallel\/\" rel=\"follow\">gnu parallel<\/a><\/li>\n<li><a href=\"https:\/\/code.google.com\/p\/iphonetunnel-usbmuxconnectbyport\/downloads\/list\" rel=\"follow\">itunnel<\/a><\/li>\n<\/ul>\n<p>If you have a jailbroken iPhone, you can connect directly to the iPhone and carry out the image optimization over ssh (via sshfs). For best performance and reliability, we&#8217;ll set up a TCP\/IP tunnel over USB instead of connecting over the wi-fi, using itunnel:<\/p>\n<pre class=\"p1\"><span class=\"s1\">.\/itnl --lport 9990 --iport 22 &amp;<\/span><\/pre>\n<p class=\"p1\">And then mount the iPhone over SSH:<\/p>\n<pre class=\"p1\">mkdir \/Volumes\/iPhone<br \/>\r\nsshfs -p9990 -o reconnect -C root@localhost:\/ \/Volumes\/iPhone\/<\/pre>\n<p class=\"p1\">And then CD into the photos directory:<\/p>\n<pre class=\"p1\">cd \/Volumes\/iPhone\/var\/mobile\/Media\/DCIM\/<\/pre>\n<p>If your iPhone isn&#8217;t jailbroken, what we&#8217;ll do instead is create a backup via iTunes, CD into the backup directory, then optimize the images on the local PC. Once that&#8217;s done, we can restore the backup to the iPhone with the new images.<\/p>\n<p>Next, we&#8217;ll optimize the images in three steps:<\/p>\n<pre class=\"p1\"><span class=\"s1\">find . -iname \"*.png\"\u00a0| parallel -j 8 --verbose 'pngcrush -brute {} {}2 &amp;&amp; mv {}2 {}' \\;<\/span><\/pre>\n<p class=\"p1\">This command uses pngcrush to optimize all PNG images, usually created by taking screenshots or saving images from the web. You can remove the -brute parameter to speed up the process significantly, at the cost of lower space savings.<\/p>\n<p class=\"p1\">Note: While pngcrush can read and write to the same file in a single pass (by specifying -ow to overwrite), this is\u00a0<em>not<\/em>\u00a0threadsafe\u00a0as it will write to a temporary file of the same name for all threads! As such, we manually specify the new file name and then move it back to overwrite the original.<\/p>\n<pre class=\"p1\"><span class=\"s1\">find . -iname \"*.jpg\"\u00a0|\u00a0parallel -j 8 --verbose jpegtran -copy none -optimize -outfile {} {} \\;<\/span><\/pre>\n<p class=\"p1\">This step uses jpegtran (preferably the mozjpeg version) to optimize all JPEG images, the default format used by the camera app on the iPhone. As jpegtran does not use a lot of CPU resources, we use 32 threads on an 8-core machine to completely saturate the USB link. You can experiment with the job count for best performance.<\/p>\n<pre class=\"p1\"><span class=\"s1\">find . -iname \"*.thm\"\u00a0|\u00a0parallel -j 8 --verbose 'cjpeg -quality 75 -optimize {} &gt; {}2 &amp;&amp; mv {}2 {}' \\; <\/span><\/pre>\n<p class=\"p1\">In this step, we recompress and optimize all thumbnails stored on the iPhone. Since thumbnails are lossy by default, we can use a lower quality version here. The degree of lossiness can be modified by changing the -quality parameter, but 75 is the most common value.<\/p>\n<p class=\"p1\">Optional: We can now re-run the above steps on \/var\/mobile\/Library\/SMS to compress PNG and JPEG attachments in messages (iMessage or SMS), to possibly save a lot more free space.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most people that have had iPhones for more than a year or two have accumulated a massive amount of photos, at least several gigabytes in size. With iPhones still only shipping with a puny 16 GiB of storage by default &hellip; <a href=\"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":505,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[107,348],"class_list":["post-3196","post","type-post","status-publish","format-standard","hentry","category-software","tag-apple","tag-iphone"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Most people that have had iPhones for more than a year or two have accumulated a massive amount of photos, at least several gigabytes in size. With iPhones still only shipping with a puny 16 GiB of storage by default (unless you pony up the $100 for a huge jump to the 64 GiB model\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Mahmoud Al-Qudsi\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#article\",\"name\":\"Free up space on an iPhone by compressing your photo album | The NeoSmart Files\",\"headline\":\"Free up space on an iPhone by compressing your photo album\",\"author\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/mqudsi\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#organization\"},\"datePublished\":\"2015-01-09T12:37:45-06:00\",\"dateModified\":\"2015-01-09T12:37:45-06:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#webpage\"},\"articleSection\":\"Software, apple, iphone\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/#listItem\",\"position\":2,\"name\":\"Software\",\"item\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#listItem\",\"name\":\"Free up space on an iPhone by compressing your photo album\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#listItem\",\"position\":3,\"name\":\"Free up space on an iPhone by compressing your photo album\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/#listItem\",\"name\":\"Software\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#organization\",\"name\":\"The NeoSmart Files\",\"description\":\"Recovery software and more\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/mqudsi\\\/#author\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/mqudsi\\\/\",\"name\":\"Mahmoud Al-Qudsi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c2643dd7c6df61aed49d9f3d917ac6d61cafbbda5f9b1619f50d3b749dca415a?s=96&d=mm&r=pg\",\"width\":96,\"height\":96,\"caption\":\"Mahmoud Al-Qudsi\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#webpage\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/\",\"name\":\"Free up space on an iPhone by compressing your photo album | The NeoSmart Files\",\"description\":\"Most people that have had iPhones for more than a year or two have accumulated a massive amount of photos, at least several gigabytes in size. With iPhones still only shipping with a puny 16 GiB of storage by default (unless you pony up the $100 for a huge jump to the 64 GiB model\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/free-up-space-on-an-iphone-by-compressing-your-photo-album\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/mqudsi\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/mqudsi\\\/#author\"},\"datePublished\":\"2015-01-09T12:37:45-06:00\",\"dateModified\":\"2015-01-09T12:37:45-06:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/\",\"name\":\"The NeoSmart Files\",\"description\":\"Recovery software and more\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Free up space on an iPhone by compressing your photo album | The NeoSmart Files","description":"Most people that have had iPhones for more than a year or two have accumulated a massive amount of photos, at least several gigabytes in size. With iPhones still only shipping with a puny 16 GiB of storage by default (unless you pony up the $100 for a huge jump to the 64 GiB model","canonical_url":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#article","name":"Free up space on an iPhone by compressing your photo album | The NeoSmart Files","headline":"Free up space on an iPhone by compressing your photo album","author":{"@id":"https:\/\/neosmart.net\/blog\/author\/mqudsi\/#author"},"publisher":{"@id":"https:\/\/neosmart.net\/blog\/#organization"},"datePublished":"2015-01-09T12:37:45-06:00","dateModified":"2015-01-09T12:37:45-06:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#webpage"},"isPartOf":{"@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#webpage"},"articleSection":"Software, apple, iphone"},{"@type":"BreadcrumbList","@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/neosmart.net\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/category\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/category\/software\/#listItem","position":2,"name":"Software","item":"https:\/\/neosmart.net\/blog\/category\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#listItem","name":"Free up space on an iPhone by compressing your photo album"},"previousItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#listItem","position":3,"name":"Free up space on an iPhone by compressing your photo album","previousItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/category\/software\/#listItem","name":"Software"}}]},{"@type":"Organization","@id":"https:\/\/neosmart.net\/blog\/#organization","name":"The NeoSmart Files","description":"Recovery software and more","url":"https:\/\/neosmart.net\/blog\/"},{"@type":"Person","@id":"https:\/\/neosmart.net\/blog\/author\/mqudsi\/#author","url":"https:\/\/neosmart.net\/blog\/author\/mqudsi\/","name":"Mahmoud Al-Qudsi","image":{"@type":"ImageObject","@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/c2643dd7c6df61aed49d9f3d917ac6d61cafbbda5f9b1619f50d3b749dca415a?s=96&d=mm&r=pg","width":96,"height":96,"caption":"Mahmoud Al-Qudsi"}},{"@type":"WebPage","@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#webpage","url":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/","name":"Free up space on an iPhone by compressing your photo album | The NeoSmart Files","description":"Most people that have had iPhones for more than a year or two have accumulated a massive amount of photos, at least several gigabytes in size. With iPhones still only shipping with a puny 16 GiB of storage by default (unless you pony up the $100 for a huge jump to the 64 GiB model","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/neosmart.net\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/#breadcrumblist"},"author":{"@id":"https:\/\/neosmart.net\/blog\/author\/mqudsi\/#author"},"creator":{"@id":"https:\/\/neosmart.net\/blog\/author\/mqudsi\/#author"},"datePublished":"2015-01-09T12:37:45-06:00","dateModified":"2015-01-09T12:37:45-06:00"},{"@type":"WebSite","@id":"https:\/\/neosmart.net\/blog\/#website","url":"https:\/\/neosmart.net\/blog\/","name":"The NeoSmart Files","description":"Recovery software and more","inLanguage":"en-US","publisher":{"@id":"https:\/\/neosmart.net\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"3196","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-23 20:09:03","updated":"2026-01-10 22:11:50","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/neosmart.net\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/neosmart.net\/blog\/category\/software\/\" title=\"Software\">Software<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tFree up space on an iPhone by compressing your photo album\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/neosmart.net\/blog\/"},{"label":"Software","link":"https:\/\/neosmart.net\/blog\/category\/software\/"},{"label":"Free up space on an iPhone by compressing your photo album","link":"https:\/\/neosmart.net\/blog\/free-up-space-on-an-iphone-by-compressing-your-photo-album\/"}],"jetpack_shortlink":"https:\/\/wp.me\/p4xDa-Py","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/3196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/users\/505"}],"replies":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/comments?post=3196"}],"version-history":[{"count":8,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/3196\/revisions"}],"predecessor-version":[{"id":3204,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/3196\/revisions\/3204"}],"wp:attachment":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/media?parent=3196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/categories?post=3196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/tags?post=3196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}