{"id":933,"date":"2025-12-10T16:26:31","date_gmt":"2025-12-10T16:26:31","guid":{"rendered":"https:\/\/blog.jadownes.com\/?p=933"},"modified":"2025-12-11T16:26:25","modified_gmt":"2025-12-11T16:26:25","slug":"making-polaroid-images","status":"publish","type":"post","link":"https:\/\/jadownes.com\/blog\/making-polaroid-images\/","title":{"rendered":"Making &#8216;Polaroid&#8217; Images"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n\n<p>For a new game I needed 70+ &#8216;polaroid&#8217; style images, but I only had regular (square) jpg images. I could think of several ways of achieving this:<\/p>\n<ul>\n<li>Manually<\/li>\n<li>An online tool<\/li>\n<li>Make a tool for myself<\/li>\n<\/ul>\n\n\n\n\n<h3><strong>Manually<\/strong><\/h3>\n<p>I could painstakingly manipulate each of the 70+ images;<\/p>\n<ul>\n<li>Open the image in a paint application (eg Gimp)&nbsp;<\/li>\n<li>Resize the image<\/li>\n<li>Increase the canvas size to provide space for the &#8216;polaroid&#8217; effect<\/li>\n<li>Reposition the actual image within the new canvas (I wasn&#8217;t sure this was auto-achievable during the canvas resizing)<\/li>\n<li>Colour the background white<\/li>\n<li>Save as&#8230;<\/li>\n<\/ul>\n<p>This would work, of course, but&#8230;yawn&#8230;and I&#8217;d probably make mistakes along the way<\/p>\n\n\n\n\n\n<h3><strong>An online tool<\/strong><\/h3>\n<p>A quick search found several tools, some free, some paid-for.<\/p>\n<p>I didn&#8217;t want to pay for something, especially as I was going to give away the results.<\/p>\n<p>And, I&#8217;m always wary of free online tools&#8230;<\/p>\n<ul>\n<li>Are they secretly copying all my data\/images for their own use?<\/li>\n<li>Are they harvesting my IP address\/cookies etc for their own nefarious use<\/li>\n<li>Are they installing some horrid virus or keyboard logger?<\/li>\n<li>They&#8217;re usually slow&#8230;all that upload|wait|download, malarky.<\/li>\n<\/ul>\n\n\n\n\n<h3><strong>Make a tool for myself<\/strong><\/h3>\n<p>I use an Apple MacBook. It has some amazing hidden powers &#8211; well, not <em>hidden<\/em>, but certainly not commonly used. So donning my explorer&#8217;s pith helmet I prepared to&nbsp;explore&#8230;<\/p>\n<p><strong>First, the&nbsp;Results<\/strong><\/p>\n<p>I created a&nbsp;tool that;<\/p>\n<ul>\n<li>Is totally free<\/li>\n<li>Uses features built into my MacBook<\/li>\n<li><ul>Simple operation:\n<li>Prompts me to select&nbsp;one or more original images from a folder<\/li>\n<li>Duplicated and processed each image<\/li>\n<li>Saved the results to a new folder<\/li>\n<\/ul><\/li>\n\n<li>Is fast! It took, ooh I don&#8217;t know, a second or two, to process 70+ files<\/li>\n<li>See examples at the top of this post (used in a webpage and randomly rotated using Javascript)<\/li>\n<li>One example shown here for easy examination&#8230;<\/li>\n<\/ul>\n\n\n\n<div class=\"editor-html-code\" data-aos=\"\">\n  <style>\n  .example {\n            display: flex; justify-content: space-between; align-items: center;\n            background: linear-gradient(135deg, #F5DEB3 0%, #F5F5DC 100%); \/* Cream gradient *\/\n            padding: 15px; border-radius: 8px; margin-bottom: 20px; flex-wrap: wrap;\n            border: 2px solid #B8860B; \/* Gold border *\/\n            box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n        }\n<\/style>\n<div class=\"example\"><img decoding=\"async\" src=\"https:\/\/blog.jadownes.com\/wp-content\/uploads\/2025\/12\/Alice-Mainchance.jpg\" alt=\"Alice Mainchance\" style=\"transform: rotate(3deg) !important;\" onerror=\"this.style.display='none'\"><\/div>\n<\/div>\n\n\n\n\n\n<p>Looks pretty good to me! &nbsp;<\/p>\n\n\n\n\n\n<h3><strong>How to create the tool?<\/strong><\/h3>\n<p>Let&#8217;s cut to the chase&#8230;<\/p>\n<ul>\n<li>Open &#8220;Automator&#8221; (the icon looks like a little robot, and he lives in your Applications folder (or look in&nbsp;Launchpad\/Other&#8230;)<\/li>\n<li>We&#8217;ll add just 4 steps:<ol>\n<li>Ask for Finder items<br>From your original image folder.&nbsp;Allow multiple items<\/li>\n<li>Copy Finder items<br>To your destination folder. Allow to replace existing files (so you can run it several times if needed).<\/li>\n<li>Scale images<br>I was starting with square images from Leonardo, 1120px x 1120px, so I scaled to 335px square<\/li>\n<li>Run Applescript<br>This is the slightly tricky and technical part. Here&#8217;s the script I used, with sizes chosen for my needs, you may need to adjust the sizes to suit.<\/li>\n<\/ol><\/li>\n\n<\/ul>\n<hr>\n<p><code>on run {input, parameters}<\/code><\/p>\n<p><code> repeat with this_file in input<\/code><\/p>\n<p><code>  set this_path to the quoted form of the POSIX path of this_file<\/code><\/p>\n<p><code>  do shell script \"sips \" &amp; this_path &amp; \" -p 455 375 --padColor FFFFFF -I\" <\/code><\/p>\n<p><code>  do shell script \"sips \" &amp; this_path &amp; \" -c 415 375 --cropOffset 40 1 -I\" <\/code><\/p>\n<p><code> end repeat<\/code><\/p>\n<p><code> return input<\/code><\/p>\n<p><code>end run<\/code><\/p>\n<hr>\n\n\n\n\n<img decoding=\"async\" src=\"https:\/\/blog.jadownes.com\/wp-content\/uploads\/2025\/12\/QoId7DkKGpUJwaSP4A5BNLEE8SCy7kWFJDJUrWJe.png\" border=\"0\" alt=\"\" class=\"img-fluid d-inline\" width=\"\" style=\"display: block;\">\n\n\n\n\n<p><strong>Things to beware<\/strong><\/p>\n<ul>\n<li>You can uncomment that &#8220;display dialog&#8221; line to see if the path is as expected<\/li>\n<li>For the &#8220;do shell script&#8221; commands, ensure there are spaces around the quoted-path (ie after &#8216;sips &#8216; and before &#8216; -p\/c&#8230;&#8217;<\/li>\n<li>Padding adds space evenly&nbsp;around the original image, hence the need to follow-up with a &#8216;crop&#8217; command.&nbsp;<\/li>\n<li>To get the polaroid shape, we want to discard most of the top padding, hence we start the crop (using &#8216;offset&#8217;) at 40px<\/li>\n<li>If required, you could add a dark border by repeating the pad\/crop with a dark background<\/li>\n<li>Weirdly, the x crop-offset must be &gt; 0 (hence I used 1) else you get no change to the image.<\/li>\n<\/ul>\n\n\n\n\n<h2><strong>That&#8217;s all !<\/strong><\/h2>\n<p>I hope this helps someone else out.&nbsp;<\/p>\n<p>Leave a comment if it does!<\/p>\n\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a new game I needed 70+ &#8216;polaroid&#8217; style images, but I only had regular (square) jpg images. I could think of several ways of achieving this: Manually An online tool Make a tool for myself Manually I could painstakingly manipulate each of the 70+ images; Open the image in a paint application (eg Gimp)&nbsp; &#8230; <a title=\"Making &#8216;Polaroid&#8217; Images\" class=\"read-more\" href=\"https:\/\/jadownes.com\/blog\/making-polaroid-images\/\" aria-label=\"Read more about Making &#8216;Polaroid&#8217; Images\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":896,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-933","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/posts\/933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/comments?post=933"}],"version-history":[{"count":3,"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/posts\/933\/revisions"}],"predecessor-version":[{"id":1082,"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/posts\/933\/revisions\/1082"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/media\/896"}],"wp:attachment":[{"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/media?parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/categories?post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jadownes.com\/blog\/wp-json\/wp\/v2\/tags?post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}