<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>JackBarker.com.au</title>
    <description>Business Analyst, Coder, Food Truck aficionado, and Mountain bike enthusiast.</description>
    <link>https://jackbarker.com.au/</link>
    <atom:link href="https://jackbarker.com.au/longform-feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sat, 13 Jun 2026 04:55:58 +0000</pubDate>
    <lastBuildDate>Sat, 13 Jun 2026 04:55:58 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Converting a spreadsheet into an interactive tree diagram</title>
        <description>&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;
&lt;p&gt;A little while ago, I worked on a project that would let me create a tree diagram, based on the contents of an Excel file.&lt;/p&gt;

&lt;p&gt;I wanted to build the diagram using an Excel file that I already had.&lt;/p&gt;

&lt;p&gt;The Excel file looked like this:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Parent node&lt;/th&gt;
      &lt;th&gt;Child node&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td&gt;Customer&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Customer&lt;/td&gt;
      &lt;td&gt;Customer ID&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Customer&lt;/td&gt;
      &lt;td&gt;Given name&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Customer&lt;/td&gt;
      &lt;td&gt;Surname&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Customer&lt;/td&gt;
      &lt;td&gt;Address&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Address&lt;/td&gt;
      &lt;td&gt;Street Number&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Address&lt;/td&gt;
      &lt;td&gt;Street Name&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Address&lt;/td&gt;
      &lt;td&gt;State&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Address&lt;/td&gt;
      &lt;td&gt;Suburb&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Customer&lt;/td&gt;
      &lt;td&gt;Account&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Account&lt;/td&gt;
      &lt;td&gt;Account ID&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Account&lt;/td&gt;
      &lt;td&gt;Account Type&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Here is my resultant D3.js Tree Diagram:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(Click on the “Address” node, and watch the diagram collapse)&lt;/p&gt;

&lt;style&gt;
    .node {
        cursor: pointer;
    }
    
    .overlay{
        background-color:#EEE;
    }
    
    .node circle {
        fill: #fff;
        stroke: steelblue;
        stroke-width: 1.5px;
    }
    
    .node text {
        font-size:10px;
        font-family:sans-serif;
    }
    
    .link {
        fill: none;
        stroke: #ccc;
        stroke-width: 1.5px;
    }
    
    .templink {
        fill: none;
        stroke: red;
        stroke-width: 3px;
    }
    
    .ghostCircle.show{
        display:block;
    }
    
    .ghostCircle, .activeDrag .ghostCircle{
        display: none;
    }
&lt;/style&gt;

&lt;div id=&quot;tree-container&quot;&gt;&lt;/div&gt;

&lt;script&gt;
    var data=[
     { &quot;name&quot; : &quot;Customer&quot;, &quot;parent&quot; : &quot;null&quot; }
    ,{ &quot;name&quot; : &quot;Customer ID&quot;, &quot;parent&quot; : &quot;Customer&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Given name&quot;, &quot;parent&quot; : &quot;Customer&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Surname&quot;, &quot;parent&quot; : &quot;Customer&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Address&quot;, &quot;parent&quot; : &quot;Customer&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Street Number&quot;, &quot;parent&quot; : &quot;Address&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Street Name&quot;, &quot;parent&quot; : &quot;Address&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;State&quot;, &quot;parent&quot; : &quot;Address&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Suburb&quot;, &quot;parent&quot; : &quot;Address&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Account&quot;, &quot;parent&quot; : &quot;Customer&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Account ID&quot;, &quot;parent&quot; : &quot;Account&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ,{ &quot;name&quot; : &quot;Account Type&quot;, &quot;parent&quot; : &quot;Account&quot;, &quot;dataType&quot; : &quot;&quot;, &quot;occurrence&quot; : &quot;&quot;}
    ];
    
    /* Data Conversion functions: */
    
    var dataMap = data.reduce(function(map, node) {
        map[node.name] = node;
        return map;
    }, {});
    
    /* create the tree array */
    var myTreeData = [];
    data.forEach(function(node) {
        /* add to parent */
        var parent = dataMap[node.parent];
        if (parent) {
        /* create child array if it doesn&apos;t exist */
        (parent.children || (parent.children = []))
            /* add node to child array */
            .push(node);
        } else {
        /* parent is null or missing */
            myTreeData.push(node);
        }
    });
    
    /* Code from bl.ocks.org/mbostock/4339083: */
    var margin = {top: 20, right: 120, bottom: 20, left: 120},
        width = 960 - margin.right - margin.left,
        height = 800 - margin.top - margin.bottom;
    
    var i = 0,
        duration = 750,
        root;
    
    var tree = d3.layout.tree()
        .size([height, width]);
    
    var diagonal = d3.svg.diagonal()
        .projection(function(d) { return [d.y, d.x]; });
    
    var svg = d3.select(&quot;#tree-container&quot;).append(&quot;svg&quot;)
        .attr(&quot;width&quot;, width + margin.right + margin.left)
        .attr(&quot;height&quot;, height + margin.top + margin.bottom)
        .append(&quot;g&quot;)
        .attr(&quot;transform&quot;, &quot;translate(&quot; + margin.left + &quot;,&quot; + margin.top + &quot;)&quot;);
    
    
      root = myTreeData[0];
      root.x0 = height / 2;
      root.y0 = 0;
    
      function collapse(d) {
        if (d.children) {
          d._children = d.children;
          d._children.forEach(collapse);
          d.children = null;
        }
      }
    
     /* root.children.forEach(collapse); */
      update(root);
    
    d3.select(self.frameElement).style(&quot;height&quot;, &quot;800px&quot;);
    
    function update(source) {
    
      /* Compute the new tree layout. */
      var nodes = tree.nodes(root).reverse(),
          links = tree.links(nodes);
    
      /* Normalize for fixed-depth. */
      nodes.forEach(function(d) { d.y = d.depth * 180; });
    
      /* Update the nodes… */
      var node = svg.selectAll(&quot;g.node&quot;)
          .data(nodes, function(d) { return d.id || (d.id = ++i); });
    
      /* Enter any new nodes at the parent&apos;s previous position. */
      var nodeEnter = node.enter().append(&quot;g&quot;)
          .attr(&quot;class&quot;, &quot;node&quot;)
          .attr(&quot;transform&quot;, function(d) { return &quot;translate(&quot; + source.y0 + &quot;,&quot; + source.x0 + &quot;)&quot;; })
          .on(&quot;click&quot;, click);
    
      nodeEnter.append(&quot;circle&quot;)
          .attr(&quot;r&quot;, 1e-6)
          .style(&quot;fill&quot;, function(d) { return d._children ? &quot;lightsteelblue&quot; : &quot;#fff&quot;; });
    
      nodeEnter.append(&quot;text&quot;)
          .attr(&quot;x&quot;, function(d) { return d.children || d._children ? -10 : 10; })
          .attr(&quot;dy&quot;, &quot;.35em&quot;)
          .attr(&quot;text-anchor&quot;, function(d) { return d.children || d._children ? &quot;end&quot; : &quot;start&quot;; })
          .text(function(d) { return d.name; })
          .style(&quot;fill-opacity&quot;, 1e-6);
    
      /* Transition nodes to their new position. */
      var nodeUpdate = node.transition()
          .duration(duration)
          .attr(&quot;transform&quot;, function(d) { return &quot;translate(&quot; + d.y + &quot;,&quot; + d.x + &quot;)&quot;; });
    
      nodeUpdate.select(&quot;circle&quot;)
          .attr(&quot;r&quot;, 4.5)
          .style(&quot;fill&quot;, function(d) { return d._children ? &quot;lightsteelblue&quot; : &quot;#fff&quot;; });
    
      nodeUpdate.select(&quot;text&quot;)
          .style(&quot;fill-opacity&quot;, 1);
    
      /* Transition exiting nodes to the parent&apos;s new position. */
      var nodeExit = node.exit().transition()
          .duration(duration)
          .attr(&quot;transform&quot;, function(d) { return &quot;translate(&quot; + source.y + &quot;,&quot; + source.x + &quot;)&quot;; })
          .remove();
    
      nodeExit.select(&quot;circle&quot;)
          .attr(&quot;r&quot;, 1e-6);
    
      nodeExit.select(&quot;text&quot;)
          .style(&quot;fill-opacity&quot;, 1e-6);
    
      /* Update the links… */
      var link = svg.selectAll(&quot;path.link&quot;)
          .data(links, function(d) { return d.target.id; });
    
      /* Enter any new links at the parent&apos;s previous position. */
      link.enter().insert(&quot;path&quot;, &quot;g&quot;)
          .attr(&quot;class&quot;, &quot;link&quot;)
          .attr(&quot;d&quot;, function(d) {
            var o = {x: source.x0, y: source.y0};
            return diagonal({source: o, target: o});
          });
    
      /* Transition links to their new position. */
      link.transition()
          .duration(duration)
          .attr(&quot;d&quot;, diagonal);
    
      /* Transition exiting nodes to the parent&apos;s new position. */
      link.exit().transition()
          .duration(duration)
          .attr(&quot;d&quot;, function(d) {
            var o = {x: source.x, y: source.y};
            return diagonal({source: o, target: o});
          })
          .remove();
    
      /* Stash the old positions for transition. */
      nodes.forEach(function(d) {
        d.x0 = d.x;
        d.y0 = d.y;
      });
    }
    
    /* Toggle children on click. */
    function click(d) {
      if (d.children) {
        d._children = d.children;
        d.children = null;
      } else {
        d.children = d._children;
        d._children = null;
      }
      update(d);
    }
    
&lt;/script&gt;

&lt;p&gt;I wanted to use Excel because this made for easy collaboration with other users (technical and non-technical).&lt;/p&gt;

&lt;p&gt;Once all the data had been entered into Excel, anybody on the team could run the script, and produce the resultant diagram.&lt;/p&gt;

&lt;h2 id=&quot;solution&quot;&gt;Solution&lt;/h2&gt;
&lt;p&gt;After a bunch of Googling (and visits to Stack Overflow), I finally cobbled together a quick VB script (inspired by &lt;a href=&quot;https://bl.ocks.org/mbostock/4339083&quot; target=&quot;_blank&quot;&gt;Mike Bostok&lt;/a&gt;) that would accept my file and then output the necessary html and javascript.&lt;/p&gt;

&lt;p&gt;Feel free to &lt;a href=&quot;https://github.com/jibbius/D3js_ExcelToDiagram&quot; target=&quot;_blank&quot;&gt;try it out yourself&lt;/a&gt;:&lt;/p&gt;

&lt;figure class=&quot;hero-image &quot;&gt;
    
    
    &lt;img src=&quot;/images/dist/2025/d3js_howto-700w.jpg&quot; srcset=&quot;/images/dist/2025/d3js_howto-700w.jpg 700w, /images/dist/2025/d3js_howto-1400w.jpg 1400w, /images/dist/2025/d3js_howto-2100w.jpg 2100w&quot; sizes=&quot;(min-width: 1200px) 1200px, (min-width: 800px) 100vw, 100vw&quot; alt=&quot;Interactive CSV to Tree Diagram conversion workflow showing Excel/CSV input transforming into beautiful D3.js visualizations&quot; title=&quot;Interactive CSV to Tree Diagram conversion workflow showing Excel/CSV input transforming into beautiful D3.js visualizations&quot; loading=&quot;lazy&quot; /&gt;
    
    
    &lt;figcaption&gt;Complete workflow: CSV data → Cross-platform processing → Interactive tree visualizations&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;style&gt;
.hero-image {
    margin: 2rem 0;
    width: 100%;
    max-width: none;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.02);
}

.hero-image figcaption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 1rem;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .hero-image {
        margin: 1rem 0;
    }
    
    .hero-image img {
        border-radius: 4px;
    }
}
&lt;/style&gt;

</description>
        <pubDate>Sun, 09 Nov 2025 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/blog/2025/11/09/easy-csv-to-tree-diagram</link>
        <guid isPermaLink="true">https://jackbarker.com.au/blog/2025/11/09/easy-csv-to-tree-diagram</guid>
        
        <category>javascript</category>
        
        <category>data</category>
        
        <category>data visualisation</category>
        
        <category>shell scripting</category>
        
        <category>d3js</category>
        
        <category>csv</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 8): Post production</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h1 id=&quot;post-production-overview&quot;&gt;Post-production Overview&lt;/h1&gt;
&lt;p&gt;Before I get into the detail I’d just like to say a quick &lt;strong&gt;thank you&lt;/strong&gt; to everyone who’s followed along with all the steps thus far. Also a &lt;strong&gt;thanks&lt;/strong&gt; to those who waited so patiently for this post to come out.&lt;/p&gt;

&lt;p&gt;It’s been a journey to get this working &lt;em&gt;just right&lt;/em&gt; (so I hope you like it!).&lt;/p&gt;

&lt;h2 id=&quot;introducing-the-photo-processing-application&quot;&gt;Introducing: The “Photo Processing” application&lt;/h2&gt;
&lt;p&gt;In parts 1 through 7, we built a photo booth that is able to &lt;strong&gt;save photos&lt;/strong&gt; and &lt;strong&gt;store them on the Raspberry Pi’s SD card&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this, part 8, we’ll be looking to achieve the following:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Write a new “photo processing” application, that we can run alongside our “photo booth” application.&lt;/li&gt;
  &lt;li&gt;Our photo processing application will be configured to:
    &lt;ul&gt;
      &lt;li&gt;improve image brightness,&lt;/li&gt;
      &lt;li&gt;apply some image compression,&lt;/li&gt;
      &lt;li&gt;create animated gifs,&lt;/li&gt;
      &lt;li&gt;create a “photo strip” layout,&lt;/li&gt;
      &lt;li&gt;(and if you’re keen to do some further coding, you can add even more functionality if you like) :wink:.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Upload our images to Dropbox.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;why-a-separate-application&quot;&gt;Why a separate application?&lt;/h2&gt;
&lt;p&gt;I wanted a photo uploading solution that gives people the flexibility to choose how their photos get processed, published, shared;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Not everyone will want to publish their photo booth online.&lt;/li&gt;
  &lt;li&gt;Not everyone will want to publish their photos in the same way.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this reason, my “photo publishing” is going to be a separate application which sits adjacent to the photo booth application.&lt;/p&gt;

&lt;p&gt;The applications can either be run &lt;strong&gt;simultaneously&lt;/strong&gt; (Photos will be captured, and uploaded, during the photo booth event), or at different times (i.e. “Photo booth” application can be run during a daytime event and the “Photo processing” application can be run afterwards). The latter option might be more suitable if you don’t have internet access available.&lt;/p&gt;

&lt;p&gt;When the photo publishing application is running, it will routinely check our photo directory to determine if any new photos have been saved, and will then execute the applicable logic.&lt;/p&gt;

&lt;h1 id=&quot;installing-and-running-the-app&quot;&gt;Installing and running the app&lt;/h1&gt;
&lt;h2 id=&quot;step-1--install-pre-requisisites&quot;&gt;Step 1 : Install Pre-requisisites&lt;/h2&gt;
&lt;p&gt;Let’s install some additional apps onto our Raspberry Pi to help us with the tasks I’ve listed above.&lt;/p&gt;

&lt;h3 id=&quot;11--installing-imagemagick&quot;&gt;1.1 : Installing ImageMagick&lt;/h3&gt;
&lt;p&gt;Imagemagick will help us fine tune our images (compression; brightness; layouts …etc.).&lt;/p&gt;

&lt;p&gt;We install ImageMagick from our Rasberry Pi’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terminal&lt;/code&gt; with the following commands:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;    &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
    &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;imagemagick libmagickcore-dev libmagickwand-dev libmagic-dev build-essential &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;cd
    &lt;/span&gt;wget https://www.imagemagick.org/download/ImageMagick.tar.gz
    &lt;span class=&quot;nb&quot;&gt;tar &lt;/span&gt;xvzf ImageMagick.tar.gz
    &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ImageMagick-&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
    ./configure
    make clean
    make
    &lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;make &lt;span class=&quot;nb&quot;&gt;install
    sudo &lt;/span&gt;ldconfig /usr/local/lib&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;We can confirm that the application installed correctly, by entering &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;magick -version&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/magick-version-700w.jpg&quot; alt=&quot;Checking the version of ImageMagick&quot; title=&quot;Checking the version of ImageMagick&quot; srcset=&quot;/images/dist/2018/magick-version-700w.jpg 700w, /images/dist/2018/magick-version-1400w.jpg 1400w, /images/dist/2018/magick-version-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;h3 id=&quot;12--installing-the-dropbox-python-sdk&quot;&gt;1.2 : Installing the Dropbox Python SDK&lt;/h3&gt;
&lt;p&gt;We’re also going to start interacting with Dropbox from within our Python application.&lt;/p&gt;

&lt;p&gt;In order to do that we need to install the Dropbox Python SDK, also from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terminal&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;    &lt;span class=&quot;c&quot;&gt;# This python library will help us upload our images to Dropbox:&lt;/span&gt;
    pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;dropbox

    &lt;span class=&quot;c&quot;&gt;# Or, if using Python 3 instead:&lt;/span&gt;
    python3 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;dropbox&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;13--installing-yaml-parser&quot;&gt;1.3 : Installing YAML parser&lt;/h3&gt;
&lt;p&gt;The configuration file for our application is written using the YAML language.&lt;/p&gt;

&lt;p&gt;To assist Python in being able to interpret this file, we are also going to ensure that the our YAML-parsing library is installed:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;    &lt;span class=&quot;c&quot;&gt;# This python library will help us read our config file (written in YAML)&lt;/span&gt;
    pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ruamel.yaml

    &lt;span class=&quot;c&quot;&gt;# Or, if using Python 3 instead:&lt;/span&gt;
    python3 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;ruamel.yaml&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;step-2--installing-the-photo-processing-application&quot;&gt;Step 2 : Installing the “Photo processing” application&lt;/h2&gt;
&lt;p&gt;As of version 3.0 of the Photo Booth (May 2018), the two applications (i.e. the ‘Photo Booth’ and the ‘Photo Processor’) are packaged together in the one download.&lt;/p&gt;

&lt;h2 id=&quot;step-3--run-the-application&quot;&gt;Step 3 : Run the application&lt;/h2&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;    &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/photo-booth 
    python photo-processor.py&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Notice that our application now appears to be watching for files:&lt;/p&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/watching_for_new_files-700w.png&quot; alt=&quot;photo-processor.py&quot; title=&quot;photo-processor.py&quot; srcset=&quot;/images/dist/2018/watching_for_new_files-700w.png 700w, /images/dist/2018/watching_for_new_files-1400w.png 1400w, /images/dist/2018/watching_for_new_files-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Also notice that we now have a set of additional folders created in our project directory:&lt;/p&gt;

&lt;h2 id=&quot;step-4--testing-the-application&quot;&gt;Step 4 : Testing the application&lt;/h2&gt;
&lt;p&gt;Now, as an experiment we can drop a set of 4 photos into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/photos-IN&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/placing_photos_into_photos-IN_1-700w.png&quot; alt=&quot;Placing images into [photos-IN] directory&quot; title=&quot;Placing images into [photos-IN] directory&quot; srcset=&quot;/images/dist/2018/placing_photos_into_photos-IN_1-700w.png 700w, /images/dist/2018/placing_photos_into_photos-IN_1-1400w.png 1400w, /images/dist/2018/placing_photos_into_photos-IN_1-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Our application will start spitting out information to us:&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/placing_photos_into_photos-IN_2-700w.png&quot; alt=&quot;Photos are getting processed&quot; title=&quot;Photos are getting processed&quot; srcset=&quot;/images/dist/2018/placing_photos_into_photos-IN_2-700w.png 700w, /images/dist/2018/placing_photos_into_photos-IN_2-1400w.png 1400w, /images/dist/2018/placing_photos_into_photos-IN_2-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Finally, if we check our &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/photos-DONE&lt;/code&gt; folder, we can see a number of things have happened to our photos:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Each of our 4 images has been reduced in file size. The files are now 1/4 their previous size, without a noticable drop in quality.&lt;/li&gt;
  &lt;li&gt;The 4 images have also each been “auto-levelled” to help optimise their brightness / contrast (Note: this may only be noticable in poor lighting conditions).&lt;/li&gt;
  &lt;li&gt;We now have an animated “thumbnail” image, which can great for posting on the web.&lt;/li&gt;
  &lt;li&gt;We have a couple of “photo strip” layouts (1x4) and (2x2); which may be useful if we want to print our images.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/placing_photos_into_photos-3-700w.png&quot; alt=&quot;End result&quot; title=&quot;End result&quot; srcset=&quot;/images/dist/2018/placing_photos_into_photos-3-700w.png 700w, /images/dist/2018/placing_photos_into_photos-3-1400w.png 1400w, /images/dist/2018/placing_photos_into_photos-3-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Nice one!&lt;/p&gt;

&lt;h2 id=&quot;step-5--configuring-our-application&quot;&gt;Step 5 : Configuring our application&lt;/h2&gt;
&lt;p&gt;A configuration file gets created the 1st time the application is run.&lt;/p&gt;

&lt;p&gt;If we close our ‘photo processing’ application (via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\&lt;/code&gt;) then we can have a look at the configuration file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photo-processor-config.yaml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;All of the images that are output by the application can be enabled/disabled/customised, within this file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;    &lt;span class=&quot;c1&quot;&gt;#photo-processor-config.yaml&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#---------------------------&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Photo Processor Config:&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Images to Output&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;OUTPUT_OPTIMISED_STILLS&quot;&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;OUTPUT_ANIMATED_THUMBNAILS&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;OUTPUT_LAYOUTS&quot;&lt;/span&gt;             &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;True&lt;/span&gt;

    &lt;span class=&quot;s&quot;&gt;# Directories&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;INPUT_DIRECTORY&quot;&lt;/span&gt;      &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;photos-IN&quot;&lt;/span&gt;          &lt;span class=&quot;c1&quot;&gt;# Files will be taken from here.&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;PROCESSING_DIRECTORY&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;photos-PROCESSING&quot;&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# Files will temporarily occupy this folder, whilst being processed.&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;OUTPUT_DIRECTORY&quot;&lt;/span&gt;     &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;photos-DONE&quot;&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;# Files will be placed in this folder, once all processing is complete.&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Image compression&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;IMAGE_QUALITY&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;90&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#Thumbnails config&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;THUMBNAILS_IMAGE_QUALITY&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;THUMBNAILS_SIZE&quot;&lt;/span&gt;          &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# List of print layouts to produce (1 column, 2 column)&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;LAYOUTS&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;TILE&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;1x&quot;&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;SIZE&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;1920x1152&quot;&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;MARGIN&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;20&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;TILE&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;2x&quot;&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;SIZE&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;1920x1152&quot;&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;MARGIN&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;20&quot;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# Dropbox&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;DROPBOX_ENABLED&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;False&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;DROPBOX_TOKEN&quot;&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;step-6--dropbox-integration&quot;&gt;Step 6 : Dropbox Integration&lt;/h2&gt;
&lt;p&gt;By default ‘Dropbox Upload’ is disabled.&lt;/p&gt;

&lt;p&gt;In order to enable Dropbox uploads we need to do some additional setup which I’ve described below.&lt;/p&gt;

&lt;h3 id=&quot;61--get-a-dropbox-account&quot;&gt;6.1 : Get a Dropbox Account&lt;/h3&gt;
&lt;p&gt;Dropbox is an online service which helps you to “store, share, and securely access files”.&lt;/p&gt;

&lt;p&gt;If you don’t have a Dropbox Account, you can signup for a free account &lt;a href=&quot;https://db.tt/v2aokyF4&quot;&gt;here&lt;/a&gt; (using this link will give you an extra 500Mb of storage space).&lt;/p&gt;

&lt;h3 id=&quot;62--create-a-dropbox-app-within-the-developer-page&quot;&gt;6.2 : Create a Dropbox App within the Developer page&lt;/h3&gt;
&lt;p&gt;After signing into your account, you need to navigate to the Developer section of the Dropbox website, and create an ‘Dropbox app’.&lt;/p&gt;

&lt;p&gt;To do this:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Go to the Dropbox &lt;a href=&quot;https://www.dropbox.com/developers/apps&quot;&gt;App Console&lt;/a&gt; page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click the “Create app” button:&lt;/p&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/dropbox-create-app-700w.jpg&quot; alt=&quot;Click the &apos;Create app&apos; button&quot; title=&quot;Click the &apos;Create app&apos; button&quot; srcset=&quot;/images/dist/2018/dropbox-create-app-700w.jpg 700w, /images/dist/2018/dropbox-create-app-1400w.jpg 1400w, /images/dist/2018/dropbox-create-app-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Specify:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;‘Dropbox API’&lt;/li&gt;
  &lt;li&gt;‘App folder’&lt;/li&gt;
  &lt;li&gt;A name for your app (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pi-photo-booth&lt;/code&gt; or whatever else you would like to use :smile:)&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/dropbox-create-app-form-700w.jpg&quot; alt=&quot;The Dropbox &apos;Create app&apos; form&quot; title=&quot;The Dropbox &apos;Create app&apos; form&quot; srcset=&quot;/images/dist/2018/dropbox-create-app-form-700w.jpg 700w, /images/dist/2018/dropbox-create-app-form-1400w.jpg 1400w, /images/dist/2018/dropbox-create-app-form-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Click “Create app”.&lt;/p&gt;

&lt;h3 id=&quot;63--generate-a-api-token&quot;&gt;6.3 : Generate a API token&lt;/h3&gt;

&lt;p&gt;After recording the details of our “app” with Dropbox, we also need to create a “token”.&lt;/p&gt;

&lt;p&gt;The token is similar to a password.
It allows our Raspberry Pi’s &lt;strong&gt;Photo booth&lt;/strong&gt; app to talk to the “app” we created within Dropbox.&lt;/p&gt;

&lt;p&gt;To generate a token, we need to click the “Generate” button, per the illustration below:&lt;/p&gt;

&lt;figure class=&quot;post-image small&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/dropbox-generate-token-button-700w.jpg&quot; alt=&quot;The Dropbox &apos;Generate token&apos; button&quot; title=&quot;The Dropbox &apos;Generate token&apos; button&quot; srcset=&quot;/images/dist/2018/dropbox-generate-token-button-700w.jpg 700w, /images/dist/2018/dropbox-generate-token-button-1400w.jpg 1400w, /images/dist/2018/dropbox-generate-token-button-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Once the token is generated, you need to copy it…&lt;/p&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/dropbox-token-700w.jpg&quot; alt=&quot;An example. Not my real Dropbox token.&quot; title=&quot;An example. Not my real Dropbox token.&quot; srcset=&quot;/images/dist/2018/dropbox-token-700w.jpg 700w, /images/dist/2018/dropbox-token-1400w.jpg 1400w, /images/dist/2018/dropbox-token-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;An example. Not my real Dropbox token.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;… and paste the token into our configuration file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photo-processor-config.yaml&lt;/code&gt;):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;   
    &lt;span class=&quot;c1&quot;&gt;# Dropbox&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;DROPBOX_ENABLED&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;DROPBOX_TOKEN&quot;&lt;/span&gt;   &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;qwertyuiopAAA_This_Is_Not_My_Real_Token_But_You_Get_The_Idea_AAAplkdfnvlskdmf&quot;&lt;/span&gt;
    &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Save&lt;/strong&gt; and &lt;strong&gt;close&lt;/strong&gt; the configuration file.&lt;/p&gt;

&lt;h3 id=&quot;64--test-our-changes&quot;&gt;6.4 : Test our changes&lt;/h3&gt;

&lt;p&gt;Start up the &lt;strong&gt;Photo Processor&lt;/strong&gt; app again.&lt;/p&gt;

&lt;p&gt;Copy a set of photos from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos&lt;/code&gt; directory into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos-IN&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Now watch as the photos also get uploaded to Dropbox.&lt;/p&gt;

&lt;h2 id=&quot;step-7--completing-the-file-pipeline&quot;&gt;Step 7 : Completing the file pipeline&lt;/h2&gt;

&lt;p&gt;By default:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Our photo booth application (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camera.py&lt;/code&gt;) saves all the photos it captures into a folder called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Our &lt;strong&gt;Photo Processor&lt;/strong&gt; application (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photo-processor.py&lt;/code&gt;) watches the folder called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos-IN&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;We need to manually copy our photos from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos&lt;/code&gt; into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos-IN&lt;/code&gt; folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we want this manual step to be performed automatically, then we will make one more change to our photo-booth configuration file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camera-config.yaml&lt;/code&gt;):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;    &lt;span class=&quot;c1&quot;&gt;# Additional location(s) where images will be saved to (optional):&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;COPY_IMAGES_TO&quot;&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;photos-IN&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Notice that the ‘#’ character has been removed, which preceeded “COPY_IMAGES_TO”.&lt;/p&gt;

&lt;p&gt;This will cause our images to be copied into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos-IN&lt;/code&gt; directory (in addition to saving the raw images into our &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;photos&lt;/code&gt; directory).&lt;/p&gt;

&lt;h2 id=&quot;step-8--updating-our-auto-start-script-to-also-include-the-photo-processor-application&quot;&gt;Step 8 : Updating our “Auto-start” script to also include the &lt;strong&gt;Photo Processor&lt;/strong&gt; application.&lt;/h2&gt;

&lt;p&gt;We can update our autostart script, as follows.&lt;/p&gt;

&lt;p&gt;This will ensure that both applications start automatically when we booth the Pi.&lt;/p&gt;

&lt;p&gt;(This is, of course, optional).&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Update our a new text file;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;nano /etc/xdg/autostart/autostart_photo_processor.desktop&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Populate the file with the following content:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Desktop Entry]
&lt;span class=&quot;nv&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Application
&lt;span class=&quot;nv&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;photo-processor.py
&lt;span class=&quot;nv&quot;&gt;Comment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Raspberry Pi Photo Processor 
&lt;span class=&quot;nv&quot;&gt;NoDisplay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;python /home/pi/photo-booth/photo-processor.py
&lt;span class=&quot;nv&quot;&gt;NotShowIn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;GNOME&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;KDE&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;XFCE&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
Name[en_US]&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;photo-processor.py&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Save and exit the file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;X&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For more detail about autostart scripts, refer to the earlier discussion within &lt;a href=&quot;https://jackbarker.com.au/photo-booth/6&quot;&gt;part 6&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;step-9-bonus-automatically-posting-images-to-social-media-and-other-sites&quot;&gt;Step 9 (BONUS): Automatically posting images to social media and other sites&lt;/h2&gt;

&lt;p&gt;One of the great benefts of choosing Dropbox, is that is can be used in conjunction with ITTT. ITTT is a website that can be used to automate actions between different online platforms.&lt;/p&gt;

&lt;p&gt;When a photo gets uploaded to Dropbox, when can use ITTT to trigger additional events such as:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;We send a tweet on Twitter&lt;/li&gt;
  &lt;li&gt;We publish the photo on Tumbler&lt;/li&gt;
  &lt;li&gt;We share the photo on Facebook&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ITTT is super easy to use and &lt;strong&gt;you don’t need to write any code&lt;/strong&gt;. Instead, ITTT provides a set of simple screens that are built around the phrase “If &lt;strong&gt;this&lt;/strong&gt; then &lt;strong&gt;that&lt;/strong&gt;”.&lt;/p&gt;

&lt;p&gt;As an example, lets get our photo booth to start integrating with Twitter:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Go to &lt;a href=&quot;https://ITTT.com&quot;&gt;ITTT.com&lt;/a&gt;, and Login / Register for an account.&lt;/li&gt;
  &lt;li&gt;Start a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;New applet&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Click on “If &lt;strong&gt;this&lt;/strong&gt;”, to specify the condition under which our action will be triggered:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-01-700w.jpg&quot; alt=&quot;If &apos;this&apos;...&quot; title=&quot;If &apos;this&apos;...&quot; srcset=&quot;/images/dist/2018/ITTT-01-700w.jpg 700w, /images/dist/2018/ITTT-01-1400w.jpg 1400w, /images/dist/2018/ITTT-01-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;If &apos;this&apos;...&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;ol start=&quot;4&quot;&gt;
  &lt;li&gt;Locate Dropbox:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-02-700w.jpg&quot; alt=&quot;Select &apos;Dropbox&apos;&quot; title=&quot;Select &apos;Dropbox&apos;&quot; srcset=&quot;/images/dist/2018/ITTT-02-700w.jpg 700w, /images/dist/2018/ITTT-02-1400w.jpg 1400w, /images/dist/2018/ITTT-02-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Complete the steps of connecting your Dropbox account with ITTT:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column center-text&quot;&gt;

    &lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-03-700w.jpg&quot; alt=&quot;Connect Dropbox&quot; title=&quot;Connect Dropbox&quot; srcset=&quot;/images/dist/2018/ITTT-03-700w.jpg 700w, /images/dist/2018/ITTT-03-1400w.jpg 1400w, /images/dist/2018/ITTT-03-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

  &lt;/div&gt;
&lt;div class=&quot;column center-text&quot;&gt;

    &lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-04-700w.jpg&quot; alt=&quot;Dropbox oAuth&quot; title=&quot;Dropbox oAuth&quot; srcset=&quot;/images/dist/2018/ITTT-04-700w.jpg 700w, /images/dist/2018/ITTT-04-1400w.jpg 1400w, /images/dist/2018/ITTT-04-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

  &lt;/div&gt;
&lt;/div&gt;

&lt;ol start=&quot;6&quot;&gt;
  &lt;li&gt;Choose the trigger “New photo in your folder”&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-05-700w.jpg&quot; alt=&quot;IFTTT trigger selection showing &apos;New photo in your folder&apos; option highlighted&quot; title=&quot;IFTTT trigger selection showing &apos;New photo in your folder&apos; option highlighted&quot; srcset=&quot;/images/dist/2018/ITTT-05-700w.jpg 700w, /images/dist/2018/ITTT-05-1400w.jpg 1400w, /images/dist/2018/ITTT-05-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Note: There is a limitation here. ITTT will post a maximum of 15 images per polling period (~per hour).&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;ol start=&quot;7&quot;&gt;
  &lt;li&gt;Specify the &lt;strong&gt;Dropbox subfolder&lt;/strong&gt; that ITTT will check for new images.
This will be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Apps\&lt;/code&gt; + the name of your Dropbox app + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\thumbnails&lt;/code&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-06-700w.jpg&quot; alt=&quot;Dropbox folder path configuration showing Apps subfolder with thumbnails directory&quot; title=&quot;Dropbox folder path configuration showing Apps subfolder with thumbnails directory&quot; srcset=&quot;/images/dist/2018/ITTT-06-700w.jpg 700w, /images/dist/2018/ITTT-06-1400w.jpg 1400w, /images/dist/2018/ITTT-06-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;ol start=&quot;8&quot;&gt;
  &lt;li&gt;Click on “Then &lt;strong&gt;that&lt;/strong&gt;”, to specify the action to be performed:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-07-700w.jpg&quot; alt=&quot;IFTTT action selection interface with &apos;Then that&apos; button to specify Instagram posting action&quot; title=&quot;IFTTT action selection interface with &apos;Then that&apos; button to specify Instagram posting action&quot; srcset=&quot;/images/dist/2018/ITTT-07-700w.jpg 700w, /images/dist/2018/ITTT-07-1400w.jpg 1400w, /images/dist/2018/ITTT-07-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;ol start=&quot;9&quot;&gt;
  &lt;li&gt;Locate Twitter (or another service of your choosing), and complete the remaining details:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column center-text&quot;&gt;

    &lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-08-700w.jpg&quot; alt=&quot;Choose &apos;Twitter&apos; action&quot; title=&quot;Choose &apos;Twitter&apos; action&quot; srcset=&quot;/images/dist/2018/ITTT-08-700w.jpg 700w, /images/dist/2018/ITTT-08-1400w.jpg 1400w, /images/dist/2018/ITTT-08-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

  &lt;/div&gt;
&lt;div class=&quot;column center-text&quot;&gt;

    &lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-09-700w.jpg&quot; alt=&quot;Post tweet with image&quot; title=&quot;Post tweet with image&quot; srcset=&quot;/images/dist/2018/ITTT-09-700w.jpg 700w, /images/dist/2018/ITTT-09-1400w.jpg 1400w, /images/dist/2018/ITTT-09-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column center-text&quot;&gt;

    &lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-10-700w.jpg&quot; alt=&quot;Complete action fields&quot; title=&quot;Complete action fields&quot; srcset=&quot;/images/dist/2018/ITTT-10-700w.jpg 700w, /images/dist/2018/ITTT-10-1400w.jpg 1400w, /images/dist/2018/ITTT-10-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

  &lt;/div&gt;
&lt;div class=&quot;column center-text&quot;&gt;

    &lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2018/ITTT-11-700w.jpg&quot; alt=&quot;Review and finish&quot; title=&quot;Review and finish&quot; srcset=&quot;/images/dist/2018/ITTT-11-700w.jpg 700w, /images/dist/2018/ITTT-11-1400w.jpg 1400w, /images/dist/2018/ITTT-11-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

  &lt;/div&gt;
&lt;/div&gt;
</description>
        <pubDate>Wed, 18 Apr 2018 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/8</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/8</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        <category>Python</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 7): Photo Day!</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;my-top-10-tips-for-ensuring-your-photo-booths-debut-is-stress-free&quot;&gt;My “Top 10 Tips” for ensuring your Photo Booth’s debut is stress-free&lt;/h2&gt;

&lt;p&gt;If you’ve done all your preparation correctly then hopefully you won’t need a too many tips for the day itself.&lt;/p&gt;

&lt;p&gt;In any case, I’ve try to keep this post relatively light (partly because I really want to start writing “&lt;strong&gt;Part 8: Post-production&lt;/strong&gt;”).&lt;/p&gt;

&lt;p&gt;Anyhow - here goes:&lt;/p&gt;

&lt;h3 id=&quot;1-get-heaps-of-light&quot;&gt;1. Get heaps of light&lt;/h3&gt;
&lt;p&gt;As I’ve mentioned earlier, the LEDs on my photo booth did produce &lt;em&gt;some&lt;/em&gt; light, but not enough for low light conditions. If you are taking photos in the evening or indoors then try and get every bit of lighting you can muster.&lt;/p&gt;

&lt;p&gt;Some other things to consider;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;If the venue has areas that are more well lit - then try and set up the booth in those areas.&lt;/li&gt;
  &lt;li&gt;Consider bringing along (or hiring) additional stage lighting if you think it may be necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;2-backdrop&quot;&gt;2. Backdrop&lt;/h3&gt;
&lt;p&gt;A backdrop can be as simple as a white tablecloth or curtain. This will really improve the quality of your photos.&lt;/p&gt;

&lt;p&gt;Our venue was kind enough to help out with this, but your mileage may vary.&lt;/p&gt;

&lt;p&gt;The next time I use my photo booth, I hope to &lt;strong&gt;definitely&lt;/strong&gt; be more prepared in this area. Besides… after going to all the effort of building a photo booth from scratch, constructing a backdrop should be only a minor challenge… right? :smile:&lt;/p&gt;

&lt;h3 id=&quot;3-setting-the-booths-height&quot;&gt;3. Setting the Booth’s height&lt;/h3&gt;
&lt;p&gt;If your photo booth’s dimensions are similiar to that of mine you will need elevate it somehow.&lt;/p&gt;

&lt;p&gt;You’ll need a bar stool, pedestal, or small table.&lt;/p&gt;

&lt;p&gt;Do some investigation ahead of time to determine whether your venue can help out in this regard (or alternatively bring something with you).&lt;/p&gt;

&lt;h3 id=&quot;4-costumes-and-props&quot;&gt;4. Costumes and props&lt;/h3&gt;
&lt;p&gt;Costumes and props are what photo booths are all about!&lt;/p&gt;

&lt;p&gt;Get some crazy wigs, glasses, hats.
Pinterest can be great for providing inspiration!&lt;/p&gt;

&lt;h3 id=&quot;5-write-a-check-list&quot;&gt;5. Write a Check-list&lt;/h3&gt;
&lt;p&gt;If you’ve been reading along up to here, then you might have realised just how many things will need to be &lt;strong&gt;brought to the venue&lt;/strong&gt;, and then &lt;strong&gt;set up on the day&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Additionally - if your situation is like mine - you may also have a number of other obligations on the day (i.e. getting married? :smile:).&lt;/p&gt;

&lt;p&gt;In short: Write a check list. Don’t forget stuff!&lt;/p&gt;

&lt;h3 id=&quot;6-communicate-your-requirements-with-the-venue&quot;&gt;6. Communicate your requirements with the venue&lt;/h3&gt;
&lt;p&gt;Our venues were all super helpful, but we needed to engage with them to make sure that they were “on board” with the plan.&lt;/p&gt;

&lt;p&gt;Things to discuss with the venue:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;When + what things be delivered to the venue?&lt;/li&gt;
  &lt;li&gt;What needs to be set up (also: at what time? by whom)?&lt;/li&gt;
  &lt;li&gt;What space will you be occupying?&lt;/li&gt;
  &lt;li&gt;Do you need access to power?&lt;/li&gt;
  &lt;li&gt;Where will the power leads run? Do they need to be taped down to ensure people can’t trip over them?&lt;/li&gt;
  &lt;li&gt;Who will be responsible for removing the photo booth after the event, and when?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;7-recruit-some-help&quot;&gt;7. Recruit some help&lt;/h3&gt;
&lt;p&gt;Recruiting someone to help with all of the above activities will be a huge help.&lt;/p&gt;

&lt;p&gt;Make sure that they know the basics of how the booth works, and all the arrangements that have been made with the venue.&lt;/p&gt;

&lt;h3 id=&quot;8-plan-and-rehearse&quot;&gt;8. Plan and Rehearse&lt;/h3&gt;
&lt;p&gt;The last thing that you want to be dealing with at your photo booth’s debut are software and hardware bugs. Do a thorough round of testing, and then ask some other people to have a test run also. It’s always good to get some early feedback too.&lt;/p&gt;

&lt;p&gt;You also want to be sure that everybody is aware of their responsibilities and any questions are resolved. If you have an opportunity to rehearse the setup - then go for it.&lt;/p&gt;

&lt;h3 id=&quot;9-deliver-a-sales-pitch&quot;&gt;9. Deliver a sales pitch&lt;/h3&gt;
&lt;p&gt;If you’ve reached this point (built an amazingly awesome photo booth, kitted it out with props + backdrop, and recruited an army of helpers), then it would be a real shame if your guests forget to make use of it!&lt;/p&gt;

&lt;p&gt;If your event has any speeches, or an event host, see if they can be persuaded to include a small “advertisement” for the photo booth.&lt;/p&gt;

&lt;p&gt;You can also designate some official “wranglers” to encourage people to join in.&lt;/p&gt;

&lt;p&gt;But honestly, the guests at my event seemed to need very little encouragement, because using the photo booth was a lot of fun.&lt;/p&gt;

&lt;h3 id=&quot;10-exit-strategy&quot;&gt;10. Exit strategy&lt;/h3&gt;
&lt;p&gt;Finally!&lt;/p&gt;

&lt;p&gt;The event is finished. All that is left is to clean up and make sure your photo booth gets home safely.&lt;/p&gt;

&lt;p&gt;This step isn’t particularly difficult, but again, if you are relying on others to do this for you just make sure that they know what to do.&lt;/p&gt;

&lt;h3 id=&quot;and-another-thing-have-fun&quot;&gt;And another thing: Have fun!&lt;/h3&gt;
&lt;p&gt;Chances are that even with an airtight check-list, a rehearsed set of recruits, and a winning sales pitch… there will still be small things that can go wrong.&lt;/p&gt;

&lt;p&gt;Here are just a few of the hiccups we faced on the day;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;In transporting the photo booth to the venue, we forgot a number of props! Luckily this was solved with some quick phone calls to friends who were able to find some replacements at the last minute.&lt;/li&gt;
  &lt;li&gt;During our wedding we had a (very brief) power outage. Not only did we lose the photo booth; but our band’s music went silent and we were left only with candle-light! Luckily, a few moments later the power kicked back in and all was back to normal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even with these hiccups we had a fantastic fun-filled day (it was my wedding after all)!&lt;/p&gt;

&lt;p&gt;I wish you guys all the best for your events.&lt;/p&gt;

&lt;p&gt;If anyone else has any tips, feel free to share them below :smile:.&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;

&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/8&quot;&gt;last article&lt;/a&gt; in this series, I’ll be talking about &lt;strong&gt;post-production tweaks you can make to your images&lt;/strong&gt;, and &lt;strong&gt;how to convert your photos into a website&lt;/strong&gt;.&lt;/p&gt;
</description>
        <pubDate>Sat, 14 Oct 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/7</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/7</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 6): Fine-tuning</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;overview-of-part-6&quot;&gt;Overview of Part 6&lt;/h2&gt;
&lt;p&gt;In part 6 of this series we’ll look at some additional improvements we can make for the photo booth.&lt;/p&gt;

&lt;h2 id=&quot;personalised-images&quot;&gt;Personalised images&lt;/h2&gt;
&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;assets&lt;/code&gt; directory contains a number of images.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part6_image_assets-700w.png&quot; alt=&quot;Contents of: /photo-booth/assets&quot; title=&quot;Contents of: /photo-booth/assets&quot; srcset=&quot;/images/dist/2017/photo_booth/part6_image_assets-700w.png 700w, /images/dist/2017/photo_booth/part6_image_assets-1400w.png 1400w, /images/dist/2017/photo_booth/part6_image_assets-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Directory contents: /photo-booth/assets&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;These images are used as the different “screens” within the photo booth application.&lt;/p&gt;

&lt;p&gt;You can enhance the photo booth experience for your guests by personalising these images;&lt;/p&gt;

&lt;figure class=&quot;post-image large no-border&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part6_image_asset_update_one-700w.png&quot; alt=&quot;Personalised image assets (1 of 2)&quot; title=&quot;Personalised image assets (1 of 2)&quot; srcset=&quot;/images/dist/2017/photo_booth/part6_image_asset_update_one-700w.png 700w, /images/dist/2017/photo_booth/part6_image_asset_update_one-1400w.png 1400w, /images/dist/2017/photo_booth/part6_image_asset_update_one-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;figure class=&quot;post-image large no-border&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part6_image_asset_update_two-700w.png&quot; alt=&quot;Personalised image assets (2 of 2)&quot; title=&quot;Personalised image assets (2 of 2)&quot; srcset=&quot;/images/dist/2017/photo_booth/part6_image_asset_update_two-700w.png 700w, /images/dist/2017/photo_booth/part6_image_asset_update_two-1400w.png 1400w, /images/dist/2017/photo_booth/part6_image_asset_update_two-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;h2 id=&quot;automatically-launching-the-photo-booth-app-when-the-pi-starts&quot;&gt;Automatically launching the Photo Booth app when the Pi starts&lt;/h2&gt;

&lt;p&gt;At the moment we need to start the Photo Booth script &lt;strong&gt;manually&lt;/strong&gt; after powering on the Raspberry Pi.
Ideally, however, the script should be run automatically as soon as the Pi starts up.&lt;/p&gt;

&lt;p&gt;To fix this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Create a new text file;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;nano /etc/xdg/autostart/autostart_photobooth.desktop&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Populate the file with the following content:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Desktop Entry]
&lt;span class=&quot;nv&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Application
&lt;span class=&quot;nv&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;camera.py
&lt;span class=&quot;nv&quot;&gt;Comment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Raspberry Pi Photo Booth 
&lt;span class=&quot;nv&quot;&gt;NoDisplay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;false
&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Exec&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;python /home/pi/photo-booth/camera.py
&lt;span class=&quot;nv&quot;&gt;NotShowIn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;GNOME&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;KDE&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;XFCE&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
Name[en_US]&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; camera.py&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Save and exit the file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;X&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: To later disable/re-enable this behaviour, you can simply move the file to a different location:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Disable autostart, by moving the file into home directory instead&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo mv&lt;/span&gt; /etc/xdg/autostart/autostart_photobooth.desktop ~/autostart_photobooth.desktop

&lt;span class=&quot;c&quot;&gt;# Re-enable autostart, by moving file back into autostart directory&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo mv&lt;/span&gt; ~/autostart_photobooth.desktop /etc/xdg/autostart/autostart_photobooth.desktop &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;optional-extras&quot;&gt;Optional Extras&lt;/h2&gt;

&lt;p&gt;Finally, here are some other ideas that you can add to your own photo booth.&lt;/p&gt;

&lt;p&gt;(If you do implement any of these, be sure to let me know via the comments :smile: )&lt;/p&gt;

&lt;h3 id=&quot;real-time-clock-rtc-module&quot;&gt;Real Time Clock (RTC) module&lt;/h3&gt;

&lt;p&gt;If your Pi photo booth has internet access, then the Pi’s clock will automatically be updated to the correct time upon connecting.&lt;/p&gt;

&lt;p&gt;If you are planning to operate the photo booth without internet access, you should note that the clock of the Pi will be incorrect. The impact of this, is that the filenames given to your photos (which include a timestamp as part of the filename) will not be perfectly reliable.&lt;/p&gt;

&lt;p&gt;You can choose to rectify this by installing a “Real-time clock” (RTC) module onto your Raspberry Pi. Typically, an RTC works by attaching a small battery to the Pi, which ensures that the clock remains powered after shut down.&lt;/p&gt;

&lt;p&gt;You can pick-up this piece of hardware from a local electronic store, or online from your favourite electronics supplier.&lt;/p&gt;

&lt;h3 id=&quot;shutdown-button&quot;&gt;Shutdown button&lt;/h3&gt;

&lt;p&gt;Turning off the Pi by simply cutting the power can have side effects, specifically: data loss. This is similar to removing a USB stick from your computer without using the “safely eject” menu.&lt;/p&gt;

&lt;p&gt;If you find that any of your photos get “corrupted” (usually the last one the was saved), then installing a shutdown button is one method to correct this.&lt;/p&gt;

&lt;p&gt;There are &lt;a href=&quot;https://www.raspberrypi.org/magpi/off-switch-raspberry-pi/&quot; target=&quot;_blank&quot;&gt;plenty of tutorials&lt;/a&gt; for doing this online and is a great feature to include.&lt;/p&gt;

&lt;p&gt;My code actually includes an “Exit app” feature if you attach a button across GPIO pin 13 and ground (which can also be used to avoid corrupting images).&lt;/p&gt;

&lt;h3 id=&quot;saving-photos-to-the-cloud&quot;&gt;Saving photos to the cloud&lt;/h3&gt;

&lt;p&gt;Another method to prevent data loss is to backup your photos to the cloud.&lt;/p&gt;

&lt;p&gt;Dropbox is a great (free) solution to this problem, and can be installed on a Raspberry Pi - albeit with some challenge.&lt;/p&gt;

&lt;p&gt;We’ll be looking at this further in &lt;strong&gt;part 8&lt;/strong&gt;, but there are some other ways to do this described &lt;a href=&quot;https://www.raspberrypi.org/magpi/dropbox-raspberry-pi/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;
&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/7&quot;&gt;next article&lt;/a&gt; in this series, I’ll be talking about some tips for your &lt;strong&gt;photo booth’s debut&lt;/strong&gt;, and ideally how to keep your big day “stress free”.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jackbarker.com.au/subscribe&quot;&gt;Subscribe&lt;/a&gt; to my blog to stay informed of my progress.&lt;/p&gt;
</description>
        <pubDate>Mon, 28 Aug 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/6</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/6</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 5): Writing the app</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;overview-of-part-5&quot;&gt;Overview of Part 5&lt;/h2&gt;
&lt;p&gt;Part 5 of this series is all about the code, and optimising the performance of our Pi.&lt;/p&gt;

&lt;h2 id=&quot;previous-steps&quot;&gt;Previous steps&lt;/h2&gt;
&lt;p&gt;If you’ve followed all the previous parts of this series, then so far, you’ll have:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A Raspberry Pi, running Raspian (or an OS of your choice, as described within Part 2)&lt;/li&gt;
  &lt;li&gt;The Pi will also be connected to following components;
    &lt;ul&gt;
      &lt;li&gt;An arcade button, connected across &lt;strong&gt;GPIO21&lt;/strong&gt; and &lt;strong&gt;Ground&lt;/strong&gt;.&lt;/li&gt;
      &lt;li&gt;A camera module (i.e. PiCamera)&lt;/li&gt;
      &lt;li&gt;An LED screen&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;(Presumably, all of these components will now all be housed in a photo booth enclosure also)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the remaining steps we can either;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Connect a mouse and keyboard to the Pi, or&lt;/li&gt;
  &lt;li&gt;We can remotely connect to the Raspberry Pi (via the steps described in Part 2).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Connecting to the Pi remotely has the advantage of giving you a larger screen, and is the approach I would recommend.&lt;/p&gt;

&lt;h2 id=&quot;downloading-the-code&quot;&gt;Downloading the code&lt;/h2&gt;
&lt;p&gt;As we did in Part 2, open your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terminal&lt;/code&gt; application on the Pi, and enter the following commands:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; ~/photo-booth
git clone https://github.com/jibbius/raspberry_pi_photo_booth.git ~/photo-booth&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The above will create a new directory (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/pi/photo-booth/&lt;/code&gt;), and then download the &lt;em&gt;Raspberry Pi Photo Booth&lt;/em&gt; code, for you to use.&lt;/p&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part5-git-clone-photo-booth-700w.png&quot; alt=&quot;Downloading the code with &apos;git clone&apos;&quot; title=&quot;Downloading the code with &apos;git clone&apos;&quot; srcset=&quot;/images/dist/2017/photo_booth/part5-git-clone-photo-booth-700w.png 700w, /images/dist/2017/photo_booth/part5-git-clone-photo-booth-1400w.png 1400w, /images/dist/2017/photo_booth/part5-git-clone-photo-booth-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Downloading the code with &apos;git clone&apos;&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h2 id=&quot;installing-prerequisite-packages&quot;&gt;Installing prerequisite packages&lt;/h2&gt;
&lt;p&gt;The code relies upon some additional Python libraries being downloaded also.
We can download these from the terminal:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/photo-booth
python3 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; pip &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; requirements.txt&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;getting-the-code-to-run&quot;&gt;Getting the code to run&lt;/h2&gt;
&lt;p&gt;Now that the code has downloaded, we can open up Python and run the Photo Booth code.&lt;/p&gt;

&lt;p&gt;One method of doing this, is opening the Applications menu, and selecting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Programming&lt;/code&gt; then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Python 3 (IDLE)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;em&gt;My code is also compatible with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Python 2&lt;/code&gt;, but &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Python 3&lt;/code&gt; is currently recommended.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part5-python-3-idle-700w.png&quot; alt=&quot;Locating the Python 3 GUI in Raspian&quot; title=&quot;Locating the Python 3 GUI in Raspian&quot; srcset=&quot;/images/dist/2017/photo_booth/part5-python-3-idle-700w.png 700w, /images/dist/2017/photo_booth/part5-python-3-idle-1400w.png 1400w, /images/dist/2017/photo_booth/part5-python-3-idle-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Locating the Python 3 GUI in Raspian&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;Within the Python GUI, you can then the code we downloaded via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;File&lt;/code&gt;&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Open&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Within &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/pi/photo-booth&lt;/code&gt;, locate and open &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camera.py&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part5-open-python-3-700w.png&quot; alt=&quot;Opening camera.py&quot; title=&quot;Opening camera.py&quot; srcset=&quot;/images/dist/2017/photo_booth/part5-open-python-3-700w.png 700w, /images/dist/2017/photo_booth/part5-open-python-3-1400w.png 1400w, /images/dist/2017/photo_booth/part5-open-python-3-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;We can then run the code via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;File&lt;/code&gt;&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Run Module&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part5-run-module-700w.png&quot; alt=&quot;Run module&quot; title=&quot;Run module&quot; srcset=&quot;/images/dist/2017/photo_booth/part5-run-module-700w.png 700w, /images/dist/2017/photo_booth/part5-run-module-1400w.png 1400w, /images/dist/2017/photo_booth/part5-run-module-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;h2 id=&quot;examining-the-code&quot;&gt;Examining the code&lt;/h2&gt;
&lt;h3 id=&quot;looking-under-the-hood&quot;&gt;Looking under the hood&lt;/h3&gt;
&lt;p&gt;In case you are curious, why not have a look at the code within the python file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camera.py&lt;/code&gt;?
I’ll try to explain the various parts as they appear in the file.&lt;/p&gt;

&lt;p&gt;We start off with the file header, which tells us that this is an app written in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Python&lt;/code&gt; programming language:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c1&quot;&gt;#!/bin/python&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then we have our import statements.
These statements used to include some specific Python &lt;strong&gt;libraries&lt;/strong&gt; into our app:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c1&quot;&gt;#Imports
&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;datetime&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;os&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;time&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sleep&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;PIL&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Image&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;picamera&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;RPi.GPIO&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GPIO&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;These libraries provide simple mechanisms for dealing with &lt;strong&gt;images&lt;/strong&gt;, &lt;strong&gt;timestamps&lt;/strong&gt;, the Pi’s &lt;strong&gt;GPIO pins&lt;/strong&gt;, and other complex features. This means our code doesn’t need to consider all of the intricacies that are associated with such things, and that saves us a bunch of time.&lt;/p&gt;

&lt;h3 id=&quot;configurable-options&quot;&gt;Configurable options&lt;/h3&gt;
&lt;p&gt;Further down the file, are a set of variables that will be used by our code:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c1&quot;&gt;########################
### Variables Config ###
########################
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pin_camera_btn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;21&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# pin that the button is attached to
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;total_pics&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;# number of pics to be taken
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;prep_delay&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;# number of seconds as users prepare to have photo taken
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;photo_w&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1920&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;# take photos at this resolution
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;photo_h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1152&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;screen_w&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;800&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;# resolution of the photo booth display
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;screen_h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;480&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;div class=&quot;callout&quot;&gt;

  &lt;p&gt;Update (April 2018):&lt;/p&gt;
  &lt;ul&gt;
    &lt;li&gt;The photo booth is now version 2.&lt;/li&gt;
    &lt;li&gt;The &lt;strong&gt;Configurable options&lt;/strong&gt; are now defined within &lt;strong&gt;config.yaml&lt;/strong&gt; instead (otherwise, the behaviour is the same).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;p&gt;You can modify any of the values above to adjust the behaviour of the photo booth.&lt;/p&gt;

&lt;p&gt;Additional configuration applies when initialising the camera:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c1&quot;&gt;#Setup Camera
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;picamera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PiCamera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rotation&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;270&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Per the above, my camera is mounted with a &lt;strong&gt;rotation&lt;/strong&gt; of &lt;strong&gt;270°&lt;/strong&gt;, but if your camera is mounted at a different angle then you will need to adjust this value.&lt;/p&gt;

&lt;h2 id=&quot;the-main-loop&quot;&gt;The main loop&lt;/h2&gt;
&lt;p&gt;After defining our configuration options, there is a number of “helper functions” defined.
It’s not super important to understand how these work.&lt;/p&gt;

&lt;p&gt;Finally, the file defines the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt; function, which is effectively the “start” of the program.&lt;/p&gt;

&lt;p&gt;The first bit loads up some “intro” images, which we alternate between whilst waiting for a user to push the button:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    Main program loop
    &quot;&quot;&quot;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#Start Program
&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Welcome to the photo booth!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Press the button to take a photo&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#Start camera preview
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start_preview&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;resolution&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;screen_w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;screen_h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#Display intro screen
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;intro_image_1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;REAL_PATH&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/assets/intro_1.png&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;intro_image_2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;REAL_PATH&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;/assets/intro_2.png&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;overlay_1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;overlay_image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;intro_image_1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;overlay_2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;overlay_image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;intro_image_2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#Wait for someone to push the button&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The logic for alternating between the images looks like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;    &lt;span class=&quot;c1&quot;&gt;#Amount of cycles to wait, when alternating between each frame
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;blink_speed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#Use falling edge detection to see if button is pushed
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;is_pressed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GPIO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;wait_for_edge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pin_camera_btn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;GPIO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FALLING&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#Stay inside loop, until button is pressed
&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;is_pressed&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        
        &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;

        &lt;span class=&quot;c1&quot;&gt;#After every 5 cycles, alternate the overlay
&lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;blink_speed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;overlay_2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#make the top image fully visible
&lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;elif&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;blink_speed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;overlay_2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;alpha&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#make the top image fully transparent
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
        
        &lt;span class=&quot;c1&quot;&gt;#Regardless of what happens above...
&lt;/span&gt;        &lt;span class=&quot;c1&quot;&gt;#...restart the loop, and wait for the button to be pressed;
&lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Once the button is pressed, we:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Generate a filename for our images (which is based on the current date + time).&lt;/li&gt;
  &lt;li&gt;We are going to take 4 photos, and for each photo there is a “prep for photo” screen.&lt;/li&gt;
  &lt;li&gt;Taking all four photos, we display a “playback” animation, of each photo.&lt;/li&gt;
  &lt;li&gt;After the playback animation, the app restarts at the beginning (waiting for the button to be pressed again)&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;    &lt;span class=&quot;c1&quot;&gt;#Button has been pressed!
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;filename_prefix&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;get_base_filename_for_images&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;photo_number&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total_pics&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;prep_for_photo_screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;photo_number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;taking_photo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;photo_number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;filename_prefix&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;#thanks for playing
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;playback_screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;filename_prefix&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;further-analysis&quot;&gt;Further analysis&lt;/h2&gt;
&lt;p&gt;The photo booth app has more lines of code than makes sense to explore within this blog post. However, if you’ve followed along this far, feel free to explore these functions further.&lt;/p&gt;

&lt;p&gt;(And if you’re feeling super excited, perhaps you might even want to code up some additional features of your own?).&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;
&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/6&quot;&gt;next article&lt;/a&gt; in this series, I’ll be talking about &lt;strong&gt;further optimisations&lt;/strong&gt; to our Photo Booth’s software, namely:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Replacing the app’s stock images with your own custom ones,&lt;/li&gt;
  &lt;li&gt;Running the photo booth code as soon as the Pi starts up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://jackbarker.com.au/subscribe&quot;&gt;Subscribe&lt;/a&gt; to my blog to stay informed of my progress.&lt;/p&gt;
</description>
        <pubDate>Wed, 12 Jul 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/5</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/5</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        <category>Python</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 4):  Wiring up the Circuit</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;overview-of-part-4&quot;&gt;Overview of Part 4&lt;/h2&gt;
&lt;p&gt;Part 4 describes:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The steps I took in &lt;strong&gt;attaching&lt;/strong&gt; a 12v LED strip to my photo booth.&lt;/li&gt;
  &lt;li&gt;How to wire the photo booth&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;tools-and-materials&quot;&gt;Tools and Materials&lt;/h2&gt;
&lt;p&gt;We will need the following parts and tools (in addition to the photo booth cabinet that we built earlier):&lt;/p&gt;

&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;

      &lt;h3 id=&quot;required-parts&quot;&gt;Required Parts&lt;/h3&gt;
      &lt;ul&gt;
        &lt;li&gt;LED strip lights
          &lt;ul&gt;
            &lt;li&gt;I am using (warm) &lt;strong&gt;white colour&lt;/strong&gt; LEDS.&lt;/li&gt;
            &lt;li&gt;If you are using RGB LEDs (i.e. capable of multiple colours) this will require more complex installation&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li&gt;Power supply for the strip lights&lt;br /&gt;(needs to to supply 12 volt and support up to 2 amps)&lt;/li&gt;
        &lt;li&gt;Hookup wire&lt;/li&gt;
        &lt;li&gt;Heat shrink tubing&lt;/li&gt;
      &lt;/ul&gt;

      &lt;h3 id=&quot;required-tools&quot;&gt;Required Tools&lt;/h3&gt;
      &lt;ul&gt;
        &lt;li&gt;Drill&lt;/li&gt;
        &lt;li&gt;Soldering iron (and Solder)&lt;/li&gt;
        &lt;li&gt;Side cutters or Scissors&lt;/li&gt;
        &lt;li&gt;Wire strippers&lt;/li&gt;
      &lt;/ul&gt;

    &lt;/div&gt;
&lt;div class=&quot;column&quot;&gt;

      &lt;h3 id=&quot;optional-partstools&quot;&gt;Optional Parts/Tools&lt;/h3&gt;
      &lt;ul&gt;
        &lt;li&gt;Multimeter&lt;/li&gt;
        &lt;li&gt;Alligator clips / wires&lt;/li&gt;
        &lt;li&gt;Pair of barrel connectors (these came with my lights, but are optional.&lt;/li&gt;
        &lt;li&gt;Helping hands&lt;/li&gt;
        &lt;li&gt;Wood clamps&lt;/li&gt;
        &lt;li&gt;Wood glue&lt;/li&gt;
      &lt;/ul&gt;

    &lt;/div&gt;&lt;!-- end: column --&gt;
&lt;/div&gt;&lt;!-- end: row --&gt;
&lt;/div&gt;
&lt;!-- end: container --&gt;

&lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/tools_part4-700w.jpg&quot; alt=&quot;Parts and Tools for this step&quot; title=&quot;Parts and Tools for this step&quot; srcset=&quot;/images/dist/2017/photo_booth/tools_part4-700w.jpg 700w, /images/dist/2017/photo_booth/tools_part4-1400w.jpg 1400w, /images/dist/2017/photo_booth/tools_part4-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Parts and Tools for this step&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h2 id=&quot;the-lights&quot;&gt;The Lights&lt;/h2&gt;
&lt;h3 id=&quot;intro-to-led-strips&quot;&gt;Intro to LED strips&lt;/h3&gt;
&lt;p&gt;If you have never worked with LED strip lights before, they are really quite an interesting component.
The LED strips come in various flavours (RGB or White; Waterproof or Otherwise; …etc.), densities, levels of brightness, and levels of quality.&lt;/p&gt;

&lt;p&gt;Common to all LED strips are &lt;strong&gt;dotted line markings&lt;/strong&gt; which will occur at various intervals, indicating where you are able to cut the strip. You must only cut the strip along the dotted lines.&lt;/p&gt;

&lt;p&gt;Measure the width of the photo booth, and cut the strip at the appropriate length.&lt;/p&gt;

&lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/LED_strip_close_up-700w.jpg&quot; alt=&quot;The dotted lines indicate where you can cut the strip into smaller segments&quot; title=&quot;The dotted lines indicate where you can cut the strip into smaller segments&quot; srcset=&quot;/images/dist/2017/photo_booth/LED_strip_close_up-700w.jpg 700w, /images/dist/2017/photo_booth/LED_strip_close_up-1400w.jpg 1400w, /images/dist/2017/photo_booth/LED_strip_close_up-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;The dotted lines indicate where you can cut the strip into smaller segments.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h3 id=&quot;checking-the-electrical-resistance-of-the-led-strip&quot;&gt;Checking the electrical resistance of the LED strip&lt;/h3&gt;
&lt;p&gt;LEDs have a very low resistance - and &lt;strong&gt;as a rule&lt;/strong&gt;, you should never connect an LED directly to a power supply without the inclusion of a resistor within the circuit.&lt;/p&gt;

&lt;p&gt;However - &lt;strong&gt;most LED strips will already include the necessary resistors&lt;/strong&gt; as part of the strip, which means you don’t have to worry.&lt;/p&gt;

&lt;p&gt;We can check for the presence of such resistors by attaching the LEDs to a multimeter in resistance mode (Ω).&lt;/p&gt;

&lt;h3 id=&quot;a-quick-led-test&quot;&gt;A quick LED test&lt;/h3&gt;
&lt;p&gt;You should always get in the habit of testing your circuits early.&lt;/p&gt;

&lt;p&gt;In this case, we should test that our LED strip lights up when connected to power.
This will also allow you to determine the lights’ brightness, which may influence your design.&lt;/p&gt;

&lt;p&gt;If your lights don’t illuminate, check that you have the +ve and -ve connected to the correct terminals.&lt;/p&gt;

&lt;h3 id=&quot;preparing-the-mounting-position-for-the-lights&quot;&gt;Preparing the mounting position for the lights&lt;/h3&gt;
&lt;p&gt;Based on the brightness of my lights, I was keen to ensure that the LED Lights would deflect off my wooden “flash diffuser” rather than being pointed directly at the user of the photo booth.&lt;/p&gt;

&lt;p&gt;Regardless of your decision in this regard, you will need to drill a hole that will allow your hookup wires to connect up with the rest of the circuit.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/3_Lights_1-700w.jpg&quot; alt=&quot;The mounting position for the lights.&quot; title=&quot;The mounting position for the lights.&quot; srcset=&quot;/images/dist/2017/photo_booth/3_Lights_1-700w.jpg 700w, /images/dist/2017/photo_booth/3_Lights_1-1400w.jpg 1400w, /images/dist/2017/photo_booth/3_Lights_1-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;The mounting position for the lights.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h3 id=&quot;attaching-some-hookup-wires&quot;&gt;Attaching some hookup wires&lt;/h3&gt;
&lt;p&gt;Attach some hookup wires to your LED strip.
For obvious reasons, you want to attach these hookup wires &lt;strong&gt;before&lt;/strong&gt; the LEDs are mounted on the booth.&lt;/p&gt;

&lt;p&gt;I’ve used a barrel connector, as this means I can easily detach and re-attach the lights from the rest of the circuit.
We don’t want to solder directly to the power supply yet, as this will make it hard to&lt;/p&gt;

&lt;p&gt;When soldering:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Give your iron a few minutes to heat up to temperature.&lt;/li&gt;
  &lt;li&gt;A “helping hands” tool might make it easier to keep your components under control.&lt;/li&gt;
  &lt;li&gt;Using different colour wires will make it easier to remember which terminal is positive, and which is negative.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;mounting-the-leds-to-the-booth&quot;&gt;Mounting the LEDs to the booth&lt;/h3&gt;
&lt;p&gt;This step should be relatively simple.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Decide upon the exact position for the lights&lt;/li&gt;
  &lt;li&gt;Ensure that the hookup wires are able to pass through the hole that we drilled earlier.&lt;/li&gt;
  &lt;li&gt;Remove the sticky adhesive from the back of the light strip, and attach to the booth.&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/3_Lights_4-700w.jpg&quot; alt=&quot;Close up of the flash diffuser&quot; title=&quot;Close up of the flash diffuser&quot; srcset=&quot;/images/dist/2017/photo_booth/3_Lights_4-700w.jpg 700w, /images/dist/2017/photo_booth/3_Lights_4-1400w.jpg 1400w, /images/dist/2017/photo_booth/3_Lights_4-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Close up of the mounted lights (and flash diffuser).&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;My light strip refused to stay flat against the booth, particularly where the hookup wires were attached. I fixed this with some wood glue, and clamping the stubborn section until the glue dried.&lt;/p&gt;

&lt;h2 id=&quot;wiring-the-booth&quot;&gt;Wiring the Booth&lt;/h2&gt;
&lt;h3 id=&quot;version-1-the-power-board-method&quot;&gt;Version 1: The “Power Board Method”&lt;/h3&gt;
&lt;p&gt;For the first version, I relied on multiple power adapters to provide each of the different voltages required by the circuit.&lt;/p&gt;

&lt;p&gt;Note that (in my photo booth) the LEDs in both the arcade button &amp;amp; and LED strip include resistors which allow them to safely operate at 12v (your parts may vary).&lt;/p&gt;

&lt;figure class=&quot;post-image more-padding&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/photo_booth_power_board-700w.png&quot; alt=&quot;wiring diagram&quot; title=&quot;wiring diagram&quot; srcset=&quot;/images/dist/2017/photo_booth/photo_booth_power_board-700w.png 700w, /images/dist/2017/photo_booth/photo_booth_power_board-1400w.png 1400w, /images/dist/2017/photo_booth/photo_booth_power_board-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Photo booth: Wiring diagram.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;Rigged up in the wooden cabinet, the circuit looks like this:&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/4_Wiring_1-700w.jpg&quot; alt=&quot;Finished product&quot; title=&quot;Finished product&quot; srcset=&quot;/images/dist/2017/photo_booth/4_Wiring_1-700w.jpg 700w, /images/dist/2017/photo_booth/4_Wiring_1-1400w.jpg 1400w, /images/dist/2017/photo_booth/4_Wiring_1-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Finished product&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h3 id=&quot;version-2-a-single-power-source&quot;&gt;Version 2: A Single Power Source&lt;/h3&gt;
&lt;p&gt;The circuit design can be improved so as to include only one power source.&lt;/p&gt;

&lt;p&gt;In a future post I intend to document this further.&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;

&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/5&quot;&gt;next article&lt;/a&gt; in this series, I’ll be talking about &lt;strong&gt;writing the code&lt;/strong&gt; that will run on our photo booth.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jackbarker.com.au/subscribe&quot;&gt;Subscribe&lt;/a&gt; to my blog to stay informed of my progress.&lt;/p&gt;
</description>
        <pubDate>Thu, 22 Jun 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/4</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/4</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        <category>electronics</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 3): Building the Booth</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;overview-of-part-3&quot;&gt;Overview of Part 3&lt;/h2&gt;
&lt;p&gt;Part 3 describes the steps I took in &lt;strong&gt;making the wooden cabinet&lt;/strong&gt; for my Photo Booth.&lt;/p&gt;

&lt;p&gt;If you already have a cabinet for you photo booth (perhaps a converted wooden winebox?), then feel free to skip ahead to the next post. Otherwise, read on.&lt;/p&gt;

&lt;p&gt;I should probably also caveat this post with the fact that I am &lt;strong&gt;not&lt;/strong&gt; a master carpenter. That said, it’s a skill I am presently looking to develop.
I may have more updates to this post in future.&lt;/p&gt;

&lt;p&gt;I should also note that the cabinet I made was &lt;strong&gt;quite large&lt;/strong&gt; (far larger than is necessitated by the electronic components).
I chose to build the photo booth at this size, because I wanted people to see it and interact with it.&lt;/p&gt;

&lt;h2 id=&quot;tools-and-materials&quot;&gt;Tools and Materials&lt;/h2&gt;

&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;

    &lt;h3 id=&quot;required-materials&quot;&gt;Required Materials&lt;/h3&gt;
    &lt;ul&gt;
      &lt;li&gt;We need all of the following parts (discussed previously) on hand, because we’ll have to cut holes in the cabinet for each:
        &lt;ul&gt;
          &lt;li&gt;LED screen,&lt;/li&gt;
          &lt;li&gt;Arcade button,&lt;/li&gt;
          &lt;li&gt;The PiCamera.&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Wood; &lt;br /&gt;more specifically, I used:
        &lt;ul&gt;
          &lt;li&gt;A hard plywood for the base&lt;/li&gt;
          &lt;li&gt;Some additional plywood for support struts&lt;/li&gt;
          &lt;li&gt;A thin plywood laminate for the sides&lt;/li&gt;
          &lt;li&gt;Note that My photo booth doesn’t have a lid or back.&lt;br /&gt;This is something that you may wish to include, however.&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Wood screws,&lt;/li&gt;
      &lt;li&gt;Double-sided tape.&lt;/li&gt;
    &lt;/ul&gt;

  &lt;/div&gt;
&lt;div class=&quot;column&quot;&gt;

    &lt;h3 id=&quot;required-tools&quot;&gt;Required Tools&lt;/h3&gt;
    &lt;p&gt;The required tools are pretty basic:&lt;/p&gt;
    &lt;ul&gt;
      &lt;li&gt;Power drill, with:
        &lt;ul&gt;
          &lt;li&gt;Some standard drill bits of various sizes (for pre-drilling for your screws, starting your interior cuts)&lt;/li&gt;
          &lt;li&gt;A “spade” drill bit (cutting the hole for the Arcade button)&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;A screwdriver,&lt;/li&gt;
      &lt;li&gt;A hand saw (or power tool equivalent),&lt;/li&gt;
      &lt;li&gt;A saw for making interior cuts&lt;br /&gt;i.e.
        &lt;ul&gt;
          &lt;li&gt;A jigsaw, or&lt;/li&gt;
          &lt;li&gt;A fretsaw, or&lt;/li&gt;
          &lt;li&gt;A (possibly) coping saw (provided you have enough clearance between the frame and blade)&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;A wood file(s),&lt;/li&gt;
      &lt;li&gt;A pencil,&lt;/li&gt;
      &lt;li&gt;A tape measure,&lt;/li&gt;
      &lt;li&gt;A framing square.&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;I picked up all of the above from the local hardware store.&lt;/p&gt;
  &lt;/div&gt;&lt;!-- end: column --&gt;
&lt;/div&gt;
&lt;!-- end: row --&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;

    &lt;h3 id=&quot;optional-partstools&quot;&gt;Optional Parts/Tools&lt;/h3&gt;
    &lt;ul&gt;
      &lt;li&gt;Metal brackets (I used these in my build, but are optional),&lt;/li&gt;
      &lt;li&gt;Wood glue&lt;/li&gt;
      &lt;li&gt;A vice (to help with sawing / glueing),&lt;/li&gt;
      &lt;li&gt;Clamps (to help with glueing).&lt;/li&gt;
      &lt;li&gt;Sandpaper and paint might also go a long way in finishing your booth.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;&lt;!-- end: column --&gt;
&lt;/div&gt;
&lt;!-- end: row --&gt;

&lt;div class=&quot;image-map&quot;&gt;

    


&lt;figure class=&quot;post-image &quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/tools_part3-700w.jpg&quot; alt=&quot;Parts and Tools for this step&quot; title=&quot;Parts and Tools for this step&quot; srcset=&quot;/images/dist/2017/photo_booth/tools_part3-700w.jpg 700w, /images/dist/2017/photo_booth/tools_part3-1400w.jpg 1400w, /images/dist/2017/photo_booth/tools_part3-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Parts and Tools for this step&lt;/figcaption&gt;
    
&lt;/figure&gt;



    &lt;div class=&quot;hotspot&quot; style=&quot;top:4px; left:4px; height:503px; width:180px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:-26px; left:4px;&quot;&gt;Wood&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:4px; left:260px; height:60px; width:220px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:-26px; left:260px;&quot;&gt;Hand saw&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:90px; left:240px; height:60px; width:90px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:60px; left:240px;&quot;&gt;LED screen&lt;/div&gt;
&lt;/div&gt;

    &lt;div class=&quot;hotspot&quot; style=&quot;top:160px; left:260px; height:40px; width:50px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:130px; left:260px;&quot;&gt;Arcade button&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:210px; left:210px; height:60px; width:120px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:180px; left:210px;&quot;&gt;PiCamera v2&lt;/div&gt;
&lt;/div&gt;

    &lt;div class=&quot;hotspot&quot; style=&quot;top:70px; left:374px; height:66px; width:42px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:40px; left:374px;&quot;&gt;Wood Glue&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:100px; left:420px; height:50px; width:50px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:70px; left:420px;&quot;&gt;Double-sided tape&lt;/div&gt;
&lt;/div&gt;

    &lt;div class=&quot;hotspot&quot; style=&quot;top:30px; left:500px; height:130px; width:170px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:0px; left:500px;&quot;&gt;Power drill&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:164px; left:500px; height:92px; width:150px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:134px; left:500px;&quot;&gt;Drill bits&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:164px; left:460px; height:92px; width:34px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:134px; left:460px;&quot;&gt;Spade bit&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:270px; left:460px; height:200px; width:190px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:240px; left:460px;&quot;&gt;Jig saw&lt;/div&gt;
&lt;/div&gt;

    &lt;div class=&quot;hotspot&quot; style=&quot;top:280px; left:410px; height:226px; width:40px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:250px; left:410px;&quot;&gt;Wood file&lt;/div&gt;
&lt;/div&gt;
    &lt;div class=&quot;hotspot&quot; style=&quot;top:340px; left:374px; height:166px; width:30px;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div class=&quot;wash&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;wash-text&quot; style=&quot;top:310px; left:374px;&quot;&gt;Screwdriver&lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;build-steps&quot;&gt;Build Steps&lt;/h2&gt;

&lt;h3 id=&quot;the-base&quot;&gt;The Base&lt;/h3&gt;
&lt;p&gt;I cut the base into shape, and added &lt;strong&gt;support struts&lt;/strong&gt; on either side.&lt;/p&gt;

&lt;p&gt;Note:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A third support strut will be required for the top of the photo booth, and&lt;/li&gt;
  &lt;li&gt;A fourth (all the same size) will be used to form the flash diffuser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(It may be worthwhile to cut all these pieces at the same time).&lt;/p&gt;

&lt;h4 id=&quot;measure-once&quot;&gt;Measure Once&lt;/h4&gt;
&lt;p&gt;If you look closely you can see the pencil lines that I have ruled to help determine where to place the screws.
You should also &lt;strong&gt;pre-drill your holes&lt;/strong&gt; to prevent the wood from splitting.
Plywood is generally pretty good in this regard (i.e. better than MDF), but better to be safe than sorry.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/2_Cabinet_1-700w.jpg&quot; alt=&quot;Photo booth base&quot; title=&quot;Photo booth base&quot; srcset=&quot;/images/dist/2017/photo_booth/2_Cabinet_1-700w.jpg 700w, /images/dist/2017/photo_booth/2_Cabinet_1-1400w.jpg 1400w, /images/dist/2017/photo_booth/2_Cabinet_1-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;The base section of the photo booth.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;The base of the photo booth is pretty sturdy and heavy (in comparison to the sides).
This definitely worked in my favour, as it kept the centre of gravity low.
When we later add the screen and button to the front of the booth, we won’t be so worried about it being tipped over.&lt;/p&gt;

&lt;p&gt;The above could be improved by countersinking the screws, but I’ll leave that decision up to you.&lt;/p&gt;

&lt;h3 id=&quot;the-left-and-right-side-walls&quot;&gt;The Left and Right Side Walls&lt;/h3&gt;

&lt;p&gt;The side walls are cut, drilled, and attached to the base.
Note that when pre-drilling your holes, you will want to leave plenty of space to attach your brackets (i.e. if you are following my &lt;em&gt;exact&lt;/em&gt; design).&lt;/p&gt;

&lt;p&gt;The metal brackets are, of course, optional.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/2_Cabinet_5-700w.jpg&quot; alt=&quot;Photo booth side walls&quot; title=&quot;Photo booth side walls&quot; srcset=&quot;/images/dist/2017/photo_booth/2_Cabinet_5-700w.jpg 700w, /images/dist/2017/photo_booth/2_Cabinet_5-1400w.jpg 1400w, /images/dist/2017/photo_booth/2_Cabinet_5-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;The photo booth side walls.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h3 id=&quot;the-brass-backets&quot;&gt;The Brass Backets&lt;/h3&gt;
&lt;p&gt;If you follow the screenshots below, closely, you’ll note that I’ve been attaching some brass brackets to the build.&lt;/p&gt;

&lt;p&gt;This improved the look and stability substantially.&lt;/p&gt;

&lt;p&gt;There are six in total:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Two at the base,&lt;/li&gt;
  &lt;li&gt;Two at the top,&lt;/li&gt;
  &lt;li&gt;Two to attach the flash diffuser.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;the-front-panel&quot;&gt;The Front Panel&lt;/h3&gt;

&lt;p&gt;Ugh.&lt;/p&gt;

&lt;p&gt;This was, without a doubt, the most painful part of the cabinet.&lt;/p&gt;

&lt;h4 id=&quot;the-cut-out-for-the-screen&quot;&gt;The cut-out for the screen&lt;/h4&gt;
&lt;p&gt;My suggestions are as follows;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Trace the outline of the LED screen onto a piece of paper.&lt;/li&gt;
  &lt;li&gt;Cut out the shape which you drew onto the paper, and position it onto the piece of wood that shall be the front of the photo booth.&lt;/li&gt;
  &lt;li&gt;Try and center the piece of paper, exactly where the screen will be set&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ensure to keep;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Sufficient room &lt;strong&gt;above&lt;/strong&gt; the screen to mount the camera, and&lt;/li&gt;
  &lt;li&gt;Sufficient room &lt;strong&gt;below&lt;/strong&gt; to place the arcade button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you have determined the correct position for the screen with the paper guide, trace the shape onto the wood to be cut out.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/2_Cabinet_6-700w.jpg&quot; alt=&quot;Cutting the hole for the LED screen&quot; title=&quot;Cutting the hole for the LED screen&quot; srcset=&quot;/images/dist/2017/photo_booth/2_Cabinet_6-700w.jpg 700w, /images/dist/2017/photo_booth/2_Cabinet_6-1400w.jpg 1400w, /images/dist/2017/photo_booth/2_Cabinet_6-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Cutting the hole for the LED screen.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;In the above screenshot I have already attached the front panel, but I would strongly recommend keeping the front panel detached, while drilling and cutting the required holes.&lt;/p&gt;

&lt;p&gt;Once the shape has been sketched onto the panel, drill some holes to help you insert your saw of choice (i.e. a jigsaw), and complete the cut.&lt;/p&gt;

&lt;p&gt;Check to see if the screen fits, by holding it up against the hole.&lt;/p&gt;

&lt;p&gt;In my case, the hole was slightly too small.&lt;/p&gt;

&lt;p&gt;I spent the next hour with a wood file, gradually increasing the size of the hole, until it fit &lt;strong&gt;exactly&lt;/strong&gt;.
The process was time consuming, however the end result was a perfect fit.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/2_Cabinet_8-700w.jpg&quot; alt=&quot;Fits like a glove&quot; title=&quot;Fits like a glove&quot; srcset=&quot;/images/dist/2017/photo_booth/2_Cabinet_8-700w.jpg 700w, /images/dist/2017/photo_booth/2_Cabinet_8-1400w.jpg 1400w, /images/dist/2017/photo_booth/2_Cabinet_8-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;LED screen. Fits like a glove.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h4 id=&quot;drilling-the-holes-for-the-button-and-camera&quot;&gt;Drilling the Holes for the Button and Camera&lt;/h4&gt;
&lt;p&gt;I don’t have detailed instructions for this part, but essentially you just need to drill the holes for each component.&lt;/p&gt;

&lt;p&gt;The button includes a threaded shaft, and plastic nut.
It affixes to the front panel pretty easily.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/3_Lights_1-700w.jpg&quot; alt=&quot;Finished front panel, getting ready to attach the LED lights&quot; title=&quot;Finished front panel, getting ready to attach the LED lights&quot; srcset=&quot;/images/dist/2017/photo_booth/3_Lights_1-700w.jpg 700w, /images/dist/2017/photo_booth/3_Lights_1-1400w.jpg 1400w, /images/dist/2017/photo_booth/3_Lights_1-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Finished front panel. Getting ready to attach the LED lights &lt;br /&gt; (the lights will get discussed in a future post).&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;The camera needs to be attached to the back of the panel, to line up with the hole you have drilled.&lt;/p&gt;

&lt;p&gt;I managed to 3D print a small part that helped with this.
This isn’t entirely necessary however, as I am sure you can come up with other methods for attaching this.&lt;/p&gt;

&lt;p&gt;I’ve also attached my Raspberry Pi (inside it’s case) to the back of this panel, using double-sided tape.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/4_Wiring_4-700w.jpg&quot; alt=&quot;Back of the cabinet&quot; title=&quot;Back of the cabinet&quot; srcset=&quot;/images/dist/2017/photo_booth/4_Wiring_4-700w.jpg 700w, /images/dist/2017/photo_booth/4_Wiring_4-1400w.jpg 1400w, /images/dist/2017/photo_booth/4_Wiring_4-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Back of the cabinet&lt;br /&gt;(I&apos;ll explain the lights and wiring shortly).&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h3 id=&quot;the-flash-diffuser&quot;&gt;The Flash Diffuser&lt;/h3&gt;
&lt;p&gt;The final piece of wood that I cut was a “flash diffuser” (I will be discussing the LEDs in detail later).&lt;/p&gt;

&lt;p&gt;However, when I was installing the lights, I found that “direct light” off of the LEDs felt a bit unpleasant.&lt;/p&gt;

&lt;p&gt;By “hacking” a grooved angle into an additional piece of wood (off which the light would then bounce), the comfort was improved substantially.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/3_Lights_4-700w.jpg&quot; alt=&quot;Close up of the flash diffuser&quot; title=&quot;Close up of the flash diffuser&quot; srcset=&quot;/images/dist/2017/photo_booth/3_Lights_4-700w.jpg 700w, /images/dist/2017/photo_booth/3_Lights_4-1400w.jpg 1400w, /images/dist/2017/photo_booth/3_Lights_4-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Close up of the flash diffuser.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;This completes the woodwork section of the build.&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;

&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/4&quot;&gt;next article&lt;/a&gt; in this series, I’ll be talking about &lt;strong&gt;mounting the LED lights&lt;/strong&gt; and &lt;strong&gt;connecting up the circuits&lt;/strong&gt;.&lt;/p&gt;
</description>
        <pubDate>Tue, 16 May 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/3</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/3</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 2): Getting started with Pi and PiCamera</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;overview-of-part-2&quot;&gt;Overview of Part 2&lt;/h2&gt;
&lt;p&gt;Before providing a full set of components and plans for the Photo Booth, I’d recommend breadboarding out a simple version to get you started.&lt;/p&gt;

&lt;p&gt;If you want to skip that step, then feel free to jump ahead.&lt;/p&gt;

&lt;h2 id=&quot;getting-started-with-pi-and-picamera&quot;&gt;Getting Started with Pi and PiCamera&lt;/h2&gt;
&lt;p&gt;To start breadboarding out the photo booth, you will need:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A Raspberry Pi
    &lt;ul&gt;
      &lt;li&gt;I am using version 3 of the Raspberry Pi&lt;/li&gt;
      &lt;li&gt;I have also tested my code against;
        &lt;ul&gt;
          &lt;li&gt;Pi version 4 (works fine)&lt;/li&gt;
          &lt;li&gt;Pi version 2B (works fine)&lt;/li&gt;
          &lt;li&gt;Pi zero (works fine)&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;An SD card
    &lt;ul&gt;
      &lt;li&gt;I am using a 16Gb card, smaller cards will also work.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;A Pi Camera
    &lt;ul&gt;
      &lt;li&gt;I am using PiCamera version 2&lt;/li&gt;
      &lt;li&gt;The earlier version of the camera will also be fine (although fewer megapixels)&lt;/li&gt;
      &lt;li&gt;The Pi “High Quality” camera will also work.
        &lt;ul&gt;
          &lt;li&gt;For a photo booth using the HQ camera, you should use the 6mm (wide angle) lens.&lt;/li&gt;
          &lt;li&gt;It might be tempting to use the 16mm (Telephoto) lens, but your photos will be “too zoomed in” to photograph a group of people.&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;An LCD screen, such as: the XPT2046&lt;br /&gt;To power the screen, you will also need:
    &lt;ul&gt;
      &lt;li&gt;a spare USB phone charger, and&lt;/li&gt;
      &lt;li&gt;a spare micro USB cable&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Jumper wires
    &lt;ul&gt;
      &lt;li&gt;Get a mix of &lt;abbr title=&quot;Male-to-male&quot;&gt;M-M&lt;/abbr&gt;, &lt;abbr title=&quot;Male-to-female&quot;&gt;M-F&lt;/abbr&gt;, and &lt;abbr title=&quot;Female-to-female&quot;&gt;F-F&lt;/abbr&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;A momentary push button
    &lt;ul&gt;
      &lt;li&gt;Later on in the project, we will use a large arcade button w/ LED&lt;/li&gt;
      &lt;li&gt;If you don’t have this right now, then you can proceed with a simple momentary switch button, or by just connecting and disconnecting a wire within the circuit&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;A breadboard&lt;/li&gt;
  &lt;li&gt;A keyboard you can borrow, and connect up to the Pi.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Optional materials&lt;/strong&gt;:
    &lt;ul&gt;
      &lt;li&gt;A raspberry Pi breakout breadboard&lt;br /&gt;(you will see that I was using this in a couple of the images below; but, for this project it’s overkill and really not required)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;preparing-your-pi&quot;&gt;Preparing your Pi&lt;/h2&gt;

&lt;h3 id=&quot;installing-the-operating-system&quot;&gt;Installing the Operating System&lt;/h3&gt;
&lt;p&gt;For prototyping, I am running:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.raspberrypi.com/software/operating-systems#raspberry-pi-os-legacy&quot; title=&quot;RaspberryPi.org - Pi OS (Legacy)&quot; target=&quot;_blank&quot;&gt;Raspberry Pi OS Legacy (Buster)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Currently, we cannot use the latest version of Pi OS&lt;/strong&gt;.
This is because a number of changes were made to the handling of cameras in the latest version of Pi OS (Bullseye).
In future, I will update my code to work with the latest Pi OS, once the relevant Python code libraries (i.e. PiCamera2) are available.**&lt;/p&gt;

&lt;p&gt;To install the Pi OS onto an SD card, you will need to download the &lt;a href=&quot;https://www.raspberrypi.com/software/&quot; title=&quot;RaspberryPi.org - Raspberry Pi Imager&quot; target=&quot;_blank&quot;&gt;Raspberry Pi Imager&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For additional support in flashing Pi OS to an SD card, refer: &lt;a href=&quot;https://www.raspberrypi.org/learning/software-guide/&quot; title=&quot;RaspberryPi.org - Software Guide&quot; target=&quot;_blank&quot;&gt;Pi Software Guide&lt;/a&gt; that will help you in completing this step.&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2022/buster-700w.png&quot; alt=&quot;Installing Raspberry Pi OS Legacy (Buster)&quot; title=&quot;Installing Raspberry Pi OS Legacy (Buster)&quot; srcset=&quot;/images/dist/2022/buster-700w.png 700w, /images/dist/2022/buster-1400w.png 1400w, /images/dist/2022/buster-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Installing Raspberry Pi OS Legacy (Buster)&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h4 id=&quot;alternatives&quot;&gt;Alternatives&lt;/h4&gt;
&lt;p&gt;Using Raspian, the boot time for the Photo Booth is roughly &lt;strong&gt;40 seconds&lt;/strong&gt;, and (for me) I was content enough with this duration that I haven’t looked too far into alternatives at this stage.&lt;/p&gt;

&lt;p&gt;If you want the booth to boot faster, then you may want to look at running a more light-weight OS.
This is not a topic that I intend to cover right now, but I may cover this later after testing a few different options out.&lt;/p&gt;

&lt;h3 id=&quot;raspberry-pi-configuration&quot;&gt;Raspberry Pi Configuration&lt;/h3&gt;
&lt;p&gt;If you haven’t already done so, make sure you’ve got a keyboard and mouse plugged in to your Pi, and that the Pi is hooked up to a screen (which can even be the photo booth’s LCD screen if you like).&lt;/p&gt;

&lt;p&gt;We are going need to change a number of configuration options, in order to get the most out of out Pi.&lt;/p&gt;

&lt;p&gt;You can do this via the Raspbian application menu, selecting: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Preferences&lt;/code&gt; &amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Raspberry Pi Configuration&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Alternatively, you can access a similar set of options via the command line (using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo raspi-config&lt;/code&gt;).&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Within &lt;strong&gt;System&lt;/strong&gt;;
    &lt;ul&gt;
      &lt;li&gt;Make sure you click &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Change password&lt;/code&gt;
&lt;br /&gt;(Even though “it’s only a Pi”, it’s &lt;strong&gt;never&lt;/strong&gt; a good idea to keep using the default password &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;raspberry&lt;/code&gt;).&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part2-pi_config_system-700w.png&quot; alt=&quot;Raspberry Pi Config: System&quot; title=&quot;Raspberry Pi Config: System&quot; srcset=&quot;/images/dist/2017/photo_booth/part2-pi_config_system-700w.png 700w, /images/dist/2017/photo_booth/part2-pi_config_system-1400w.png 1400w, /images/dist/2017/photo_booth/part2-pi_config_system-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Within &lt;strong&gt;Interfaces&lt;/strong&gt;;
    &lt;ul&gt;
      &lt;li&gt;You must enable ‘Camera’.&lt;/li&gt;
      &lt;li&gt;Other useful options to enable here are:
        &lt;ul&gt;
          &lt;li&gt;‘VNC’, which lets you remotely connect to the Pi from another computer (after downloading the &lt;strong&gt;RealVNC Viewer&lt;/strong&gt; &lt;em&gt;client&lt;/em&gt; application, onto another computer).&lt;/li&gt;
          &lt;li&gt;‘SSH’, which allows you to connect remotely to the pi via an SSH terminal. This is an option for advanced users, and not required for this tutorial.&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part2-pi_config_interfaces-700w.png&quot; alt=&quot;Raspberry Pi Config: Interfaces&quot; title=&quot;Raspberry Pi Config: Interfaces&quot; srcset=&quot;/images/dist/2017/photo_booth/part2-pi_config_interfaces-700w.png 700w, /images/dist/2017/photo_booth/part2-pi_config_interfaces-1400w.png 1400w, /images/dist/2017/photo_booth/part2-pi_config_interfaces-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Within &lt;strong&gt;Localisation&lt;/strong&gt;;
    &lt;ul&gt;
      &lt;li&gt;By default, your Pi is probably configured to use a UK &lt;strong&gt;Keyboard&lt;/strong&gt;.&lt;/li&gt;
      &lt;li&gt;If your keyboard doesn’t have a pound key (£) on it, then you probably need to switch to a US keyboard (or whichever keyboard is appropriate to you).&lt;/li&gt;
      &lt;li&gt;It’s also worth changing your &lt;strong&gt;Locale&lt;/strong&gt;, &lt;strong&gt;Timezone&lt;/strong&gt;, and &lt;strong&gt;WiFi country&lt;/strong&gt; while here.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part2-pi_config_localisation-700w.png&quot; alt=&quot;Raspberry Pi Config: Localisation&quot; title=&quot;Raspberry Pi Config: Localisation&quot; srcset=&quot;/images/dist/2017/photo_booth/part2-pi_config_localisation-700w.png 700w, /images/dist/2017/photo_booth/part2-pi_config_localisation-1400w.png 1400w, /images/dist/2017/photo_booth/part2-pi_config_localisation-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

&lt;p&gt;Click &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OK&lt;/code&gt;, to save.&lt;/p&gt;

&lt;p&gt;After saving all of these options, you should restart the Pi to ensure that the changes take effect.&lt;/p&gt;

&lt;h3 id=&quot;connecting-to-wifi&quot;&gt;Connecting to WiFi&lt;/h3&gt;
&lt;p&gt;If you haven’t already done so, you’ll now want to connect your Pi to WiFi.&lt;/p&gt;

&lt;p&gt;If you are using Raspbian this is relatively straightforward (just click the wireless networking logo in the top right of the screen, and setup the network).&lt;/p&gt;

&lt;p&gt;Once you’ve connected up to WiFi, it is also possible to connect to the Pi from another computer via VNC or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SSH&lt;/code&gt;. We’ll get to this step later on.&lt;/p&gt;

&lt;h3 id=&quot;connecting-the-lcd-screen&quot;&gt;Connecting the LCD Screen&lt;/h3&gt;
&lt;p&gt;If you haven’t already done so, connect the Pi to the LCD screen that we will be using as the screen for the Photo Booth.&lt;/p&gt;

&lt;p&gt;My screen connected to the Pi via an HDMI cable.&lt;/p&gt;

&lt;p&gt;The screen also requires a separate power source (until I get around to tidying that up). The easiest way to do this is a via a spare USB phone charger and micro-USB cable.&lt;/p&gt;

&lt;p&gt;When I first connected the screen, the display settings weren’t 100% correct, but we can fix that now.&lt;/p&gt;

&lt;p&gt;Open up the &lt;strong&gt;Terminal&lt;/strong&gt;, we are going to enter the following command:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;nano /boot/config.txt
&lt;span class=&quot;c&quot;&gt;#Note: You will be prompted to enter your password&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;We can then edit the config file, and we’ll need to add the following lines of code to the end of the file;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hdmi_force_hotplug=1
start_x=1
disable_camera_led=1
gpu_mem=128
hdmi_group=2
hdmi_mode=87
hdmi_cvt=800 480 60 6 0 0 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The impact of these changes is as follows;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;hdmi_force_hotplug=1&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This forces the Pi to use HDMI mode, even if an HDMI cable is not detected.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;start_x=1&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This enables the camera module.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;disable_camera_led=1&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This disables the camera LED, which usually comes on when the camera is in use.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;gpu_mem=128&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This allocates us some memory to use the camera.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;hdmi_group=2&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This allows us to use DMT display formats.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;hdmi_mode=87&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;This allows us to specify custom display settings.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;hdmi_cvt=800 480 60 6 0 0 0&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;These are the display settings for our screen: (i.e. 800x480 pixels, 60Hz, 15:9 ratio, no margins, progressive interlace, normal)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To exit the file press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CTRL&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;X&lt;/code&gt;; and then specifying &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Y&lt;/code&gt; to save changes.&lt;/p&gt;

&lt;p&gt;After making these changes, you should &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reboot&lt;/code&gt; the Pi.&lt;/p&gt;

&lt;p&gt;If you’ve made a mistake whilst changing any of these settings, you can boot the Pi in recovery mode (hold the right &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SHIFT&lt;/code&gt; key), and then edit the config file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;e&lt;/code&gt;).&lt;/p&gt;

&lt;h3 id=&quot;connecting-the-camera&quot;&gt;Connecting the Camera&lt;/h3&gt;
&lt;p&gt;If you’ve gone with a PiCamera per my recommendation then installation is straight-forward (although perhaps a bit fiddly). The camera will connect to your Pi via a Ribbon Connector.&lt;/p&gt;

&lt;p&gt;I’d recommend looking up a YouTube video for how to connect your Pi to the camera. It is different for each version of the Pi, and the latch mechanisms can be a bit fragile if forced in the wrong manner.&lt;/p&gt;

&lt;h2 id=&quot;a-test-run-of-the-camera&quot;&gt;A Test Run of the Camera&lt;/h2&gt;
&lt;h3 id=&quot;connecting-to-the-pi-from-another-computer&quot;&gt;Connecting to the Pi from another computer&lt;/h3&gt;
&lt;p&gt;Because we will be using the LCD screen to display the camera’s output, and we still want to be able to enter commands at the same time, it is best to connect to the Pi from another computer (using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VNC Viewer&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SSH&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The easier option for beginners is using the VNC Viewer. There are instructions to help you do this, &lt;a href=&quot;https://www.raspberrypi.org/documentation/remote-access/vnc/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once we are connected to the Pi remotely, we can familiarise ourselves with the PyCamera library.&lt;/p&gt;

&lt;p&gt;Begin by opening &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Terminal&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UXTerm&lt;/code&gt; on the Pi.
You will be greeted with a command prompt.&lt;/p&gt;

&lt;p&gt;From here, we can access the python interpreter by typing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;camera-test-via-python-interpreter&quot;&gt;Camera test via Python interpreter&lt;/h3&gt;
&lt;p&gt;Within the interpreter, enter the following commands:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;picamera&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;picamera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PiCamera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start_preview&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The camera will now be displaying your picture on the screen that is connected to the Pi.&lt;/p&gt;

&lt;p&gt;(Note, if you ignored my suggestion to connect to the Pi from another computer, you can close the app by typing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ctrl&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\&lt;/code&gt;).&lt;/p&gt;

&lt;h3 id=&quot;flip-and-rotate-the-camera&quot;&gt;Flip and Rotate the camera&lt;/h3&gt;

&lt;p&gt;You may need to flip and/or rotate the picture, such that it suits the angle your camera has been mounted at.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hflip&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rotation&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;save-a-photo&quot;&gt;Save a photo&lt;/h3&gt;

&lt;p&gt;Enter a couple more commands into the terminal, to save a photo:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;filename&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&apos;~\my_test_photo.jpg&apos;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;camera&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;capture&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;filename&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Exit the python interpreter:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;nb&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;You can now see that the photo has been saved to the Pi.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; ~&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;connecting-up-the-button&quot;&gt;Connecting up the button&lt;/h2&gt;
&lt;p&gt;Now that we have a basic understanding of how our PiCamera will work, it is time to connect our button.&lt;/p&gt;

&lt;p&gt;Shutdown the Pi:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;shutdown now&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Disconnect the power supply.&lt;/p&gt;

&lt;p&gt;The button needs to connect to &lt;strong&gt;GPIO21&lt;/strong&gt; and &lt;strong&gt;Ground&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once the button is attached we can safely boot up the Pi again.&lt;/p&gt;

&lt;p&gt;Connect your button to the Pi, as follows:&lt;/p&gt;

&lt;figure class=&quot;post-image more-padding large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part2_photo_booth_camera_test_circuit-700w.png&quot; alt=&quot;wiring diagram&quot; title=&quot;wiring diagram&quot; srcset=&quot;/images/dist/2017/photo_booth/part2_photo_booth_camera_test_circuit-700w.png 700w, /images/dist/2017/photo_booth/part2_photo_booth_camera_test_circuit-1400w.png 1400w, /images/dist/2017/photo_booth/part2_photo_booth_camera_test_circuit-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Photo booth: Wiring diagram.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h2 id=&quot;running-a-test-app&quot;&gt;Running a “Test app”&lt;/h2&gt;
&lt;p&gt;Once the button is connected we can run a simplified version of our photo booth code.&lt;/p&gt;

&lt;p&gt;This piece of code doesn’t have the full functionality of my finished photo booth, but it contains “just enough” to test out the functionality that we care about and get an idea of how the finished code might look.&lt;/p&gt;

&lt;p&gt;The code we are going to run is shown here:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/jibbius/8105081adfc0d6dd7da77cd813c69593.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;Boot up your Raspberry Pi again.&lt;/p&gt;

&lt;p&gt;You can then either;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Copy the code into a text file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;simple-photo-booth.py&lt;/code&gt;) manually, or&lt;/li&gt;
  &lt;li&gt;Enter the following at the command line on the Pi to download it:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; ~/simple-photo-booth
git clone https://gist.github.com/8105081adfc0d6dd7da77cd813c69593.git ~/simple-photo-booth&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Run the code via:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/simple-photo-booth
python simple-photo-booth.py&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Press the button to test the code.&lt;/p&gt;

&lt;figure class=&quot;post-image large&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/1_Breadboarding_2-700w.jpg&quot; alt=&quot;Testing the photo booth components&quot; title=&quot;Testing the photo booth components&quot; srcset=&quot;/images/dist/2017/photo_booth/1_Breadboarding_2-700w.jpg 700w, /images/dist/2017/photo_booth/1_Breadboarding_2-1400w.jpg 1400w, /images/dist/2017/photo_booth/1_Breadboarding_2-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 770px) 700px,
    (min-width: 640px) calc(100vw - 70px),
    (min-width: 100px) calc(100vw - 40px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Testing the photo booth components&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;p&gt;To exit the &lt;strong&gt;simple photo booth&lt;/strong&gt; app, press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ctrl&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;c&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;
&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/3&quot;&gt;next article&lt;/a&gt; in this series, I’ll be talking about &lt;strong&gt;building the wood cabinet&lt;/strong&gt; that houses the photo booth.&lt;/p&gt;

&lt;p&gt;If you’d prefer to skip that step, you can jump ahead to &lt;a href=&quot;https://jackbarker.com.au/photo-booth/5&quot;&gt;Part 5&lt;/a&gt;, where we extend our “simple photo booth” code into a &lt;strong&gt;Fully-featured Photo Booth app&lt;/strong&gt;.&lt;/p&gt;

</description>
        <pubDate>Mon, 08 May 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/2</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/2</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        <category>Python</category>
        
        
      </item>
    
      <item>
        <title>Photo Booth (Part 1): Requirements</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This article is part of the &lt;em&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/em&gt; series:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;current-post&quot;&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;step-1--listing-out-the-requirements&quot;&gt;Step 1 : Listing out the requirements&lt;/h2&gt;

&lt;p&gt;Before we go into the specifics of how I built my Photo Booth, you should begin to think about the features and constraints affecting your (potential) photo booth.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Requirements?!
&lt;br /&gt; …typical bleeping Business Analyst!”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/photoBoothReqs-700w.jpg&quot; alt=&quot;Planning&quot; title=&quot;Planning&quot; srcset=&quot;/images/dist/2017/photo_booth/photoBoothReqs-700w.jpg 700w, /images/dist/2017/photo_booth/photoBoothReqs-1400w.jpg 1400w, /images/dist/2017/photo_booth/photoBoothReqs-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Make sure you are clear of your photo booth&apos;s requirements, before delving too far into the design.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h3 id=&quot;how-will-the-booth-be-powered&quot;&gt;How will the booth be powered?&lt;/h3&gt;
&lt;p&gt;For the photo booth I built, I needed the following;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;a 5 volt power supply (for the Pi), and&lt;/li&gt;
  &lt;li&gt;a USB phone charger (also delivering 5 volt) for the screen, and&lt;/li&gt;
  &lt;li&gt;a 12 volt power supply (for the LED lights)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To achieve this, I:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;included a small power board inside the photo booth cabinet, and ran an extension lead to the nearest power point.&lt;/li&gt;
  &lt;li&gt;attached each of the required power supplies to the power board.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An assumption that I was making, was that the booth would be powered from a power point. If you don’t want your booth to depend on power point access, then you will need a different solution.&lt;/p&gt;

&lt;p&gt;In a future build, I will look to tidy up the power supplies, and the possibility of running off a battery.&lt;/p&gt;

&lt;h3 id=&quot;how-much-light-will-you-need&quot;&gt;How much light will you need?&lt;/h3&gt;
&lt;p&gt;My wedding tested both of these scenarios:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Outdoors, on a relatively sunny day. (Photos came out great!)&lt;/li&gt;
  &lt;li&gt;Indoors, function venue, at night.  (Camera struggled)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here are some things to consider:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;I had added some 12v Ultra-Bright LEDs, and a custom “flash diffuser” to my photo booth.&lt;/li&gt;
  &lt;li&gt;This really didn’t produce enough light (more on that later).&lt;/li&gt;
  &lt;li&gt;I was able to remedy the situation by “touching up” the photos later (adjusting the brightness + contrast levels…etc).&lt;/li&gt;
  &lt;li&gt;If I had my time again, I would rig up some free-standing external lights. I expect this would have made a substantial improvement to the night-time photos.&lt;/li&gt;
  &lt;li&gt;It is also possible to adjust the “exposure settings” within the PiCamera code library, which might also help.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;internet-access&quot;&gt;Internet access?&lt;/h3&gt;
&lt;p&gt;Internet access will help you for two reasons:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;It will allow you to share (and backup) your photos - immediately&lt;/li&gt;
  &lt;li&gt;It will provide access to a real time clock&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Options available to you might differ based on which version of the Pi you are using:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The Raspberry Pi 2 will allow you to connect a wireless internet dongle (or via an Ethernet cable).&lt;/li&gt;
  &lt;li&gt;The Raspberry Pi 3 comes with wireless internet out of the box (no adapter required).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you choose to go without internet connectivity, then I highly recommend getting a RTC (Real Time Clock) module.
This means that you will be able to record the date + time that each photo was taken.
If the Photo Booth needs to be restarted for any reason, then this will be especially useful.&lt;/p&gt;

&lt;h3 id=&quot;how-will-you-share-your-photos&quot;&gt;How will you share your photos?&lt;/h3&gt;
&lt;p&gt;By default, photos will get written to your SD card, and you can distribute them after the event.&lt;/p&gt;

&lt;p&gt;Some other options to consider;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Upload to Dropbox (internet access required)&lt;/li&gt;
  &lt;li&gt;Upload to Website (GitHub Pages)
    &lt;ul&gt;
      &lt;li&gt;(This is how I distributed my photos).&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Upload to Tumbler / Google Photos / Similar service&lt;/li&gt;
  &lt;li&gt;Printer&lt;/li&gt;
  &lt;li&gt;Email&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;what-will-the-booth-be-made-out-of&quot;&gt;What will the booth be made out of?&lt;/h3&gt;
&lt;p&gt;I made my photo booth out of wood from the local hardware store.
That said, you might have a wooden box or crate that could easily be converted into a photo booth.&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;
&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/2&quot;&gt;next article&lt;/a&gt; in this series, I’ll be talking about &lt;strong&gt;Getting started with the Raspberry Pi&lt;/strong&gt;, and the other components that will form the photo booth.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jackbarker.com.au/subscribe&quot;&gt;Subscribe&lt;/a&gt; to my blog to stay informed of my progress.&lt;/p&gt;
</description>
        <pubDate>Mon, 01 May 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/1</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/1</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        
      </item>
    
      <item>
        <title>How to build a Photo Booth</title>
        <description>
&lt;aside class=&quot;multi-post&quot;&gt;
&lt;h3&gt;Multi-part Series&lt;/h3&gt;


&lt;p&gt;This is a multi-part series:&lt;/p&gt;


&lt;ul&gt;
&lt;li class=&quot;current-post&quot;&gt;&lt;a href=&quot;/photo-booth/&quot;&gt;How to build a Photo Booth&lt;/a&gt; &lt;strong&gt;(this post)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Part 1: &lt;a href=&quot;/photo-booth/1&quot;&gt;Requirements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 2: &lt;a href=&quot;/photo-booth/2&quot;&gt;Getting started with Pi and PiCamera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 3: &lt;a href=&quot;/photo-booth/3&quot;&gt;Building the Booth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4: &lt;a href=&quot;/photo-booth/4&quot;&gt; Wiring up the Circuit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 5: &lt;a href=&quot;/photo-booth/5&quot;&gt;Writing the app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 6: &lt;a href=&quot;/photo-booth/6&quot;&gt;Fine-tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 7: &lt;a href=&quot;/photo-booth/7&quot;&gt;Photo Day!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 8: &lt;a href=&quot;/photo-booth/8&quot;&gt;Post production&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;/aside&gt;

&lt;h2 id=&quot;my-diy-photo-booth&quot;&gt;My DIY Photo Booth&lt;/h2&gt;
&lt;h3 id=&quot;the-finished-product&quot;&gt;The Finished Product&lt;/h3&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/0_FinishedBooth_2b-700w.jpg&quot; alt=&quot;My kickass photo booth!&quot; title=&quot;My kickass photo booth!&quot; srcset=&quot;/images/dist/2017/photo_booth/0_FinishedBooth_2b-700w.jpg 700w, /images/dist/2017/photo_booth/0_FinishedBooth_2b-1400w.jpg 1400w, /images/dist/2017/photo_booth/0_FinishedBooth_2b-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Weddings, Parties, Anything: My kickass photo booth!&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h2 id=&quot;back-story&quot;&gt;Back story&lt;/h2&gt;
&lt;p&gt;Last weekend, I had an absolute blast at my wedding.&lt;/p&gt;

&lt;p&gt;So too, apparently, did my guests - who absolutely loved taking shots with the photo booth!&lt;/p&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/JWLPhotography_201704152105_LANG1749-700w.jpg&quot; alt=&quot;Photo credit: Jonathan Lang Photography&quot; title=&quot;Photo credit: Jonathan Lang Photography&quot; srcset=&quot;/images/dist/2017/photo_booth/JWLPhotography_201704152105_LANG1749-700w.jpg 700w, /images/dist/2017/photo_booth/JWLPhotography_201704152105_LANG1749-1400w.jpg 1400w, /images/dist/2017/photo_booth/JWLPhotography_201704152105_LANG1749-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Photo credit: &lt;a href=&quot;https://www.jonathanlang.com.au/&quot; target=&quot;_blank&quot;&gt;Jonathan Lang Photography&lt;/a&gt;.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/JWLPhotography_201704152106_LANG1753-700w.jpg&quot; alt=&quot;Photo credit: Jonathan Lang Photography&quot; title=&quot;Photo credit: Jonathan Lang Photography&quot; srcset=&quot;/images/dist/2017/photo_booth/JWLPhotography_201704152106_LANG1753-700w.jpg 700w, /images/dist/2017/photo_booth/JWLPhotography_201704152106_LANG1753-1400w.jpg 1400w, /images/dist/2017/photo_booth/JWLPhotography_201704152106_LANG1753-2100w.jpg 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
    &lt;figcaption&gt;Photo credit: &lt;a href=&quot;https://www.jonathanlang.com.au/&quot; target=&quot;_blank&quot;&gt;Jonathan Lang Photography&lt;/a&gt;.&lt;/figcaption&gt;
    
&lt;/figure&gt;

&lt;h2 id=&quot;where-can-i-see-the-code&quot;&gt;Where can I see the code?&lt;/h2&gt;
&lt;p&gt;The code for my photo booth is available here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/jibbius/raspberry_pi_photo_booth&quot; target=&quot;_blank&quot;&gt;https://github.com/jibbius/raspberry_pi_photo_booth&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;what-makes-this-diy-photo-booth-special&quot;&gt;What makes &lt;strong&gt;this&lt;/strong&gt; DIY photo booth special?&lt;/h2&gt;
&lt;p&gt;My photo booth is unique for the following reasons;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;It was the 1st project I &lt;strong&gt;ever&lt;/strong&gt; built with a Raspberry Pi, and it’s a great starting point for beginners.&lt;/li&gt;
  &lt;li&gt;It takes a “less is more” approach;
    &lt;ul&gt;
      &lt;li&gt;I opted to exclude features that weren’t essential.&lt;/li&gt;
      &lt;li&gt;The code runs on both &lt;strong&gt;Python 2.7&lt;/strong&gt; and &lt;strong&gt;Python 3&lt;/strong&gt;.&lt;/li&gt;
      &lt;li&gt;The code introduces very few libraries/dependencies, in the hopes of delivering a solution that “just works”.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;publicity&quot;&gt;Publicity&lt;/h2&gt;
&lt;p&gt;Since writing about my photo booth, it’s been featured in the following publications:&lt;/p&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;column&quot;&gt;



&lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;figcaption&gt;&lt;a href=&quot;https://diyodemag.com/features/pi_booth/&quot; target=&quot;_blank&quot;&gt;DIYODE, #1&lt;/a&gt;&lt;/figcaption&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part0-DIYODE_1-700w.png&quot; alt=&quot;Photo credit: Jonathan Lang Photography&quot; title=&quot;Photo credit: Jonathan Lang Photography&quot; srcset=&quot;/images/dist/2017/photo_booth/part0-DIYODE_1-700w.png 700w, /images/dist/2017/photo_booth/part0-DIYODE_1-1400w.png 1400w, /images/dist/2017/photo_booth/part0-DIYODE_1-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;


&lt;/div&gt;
&lt;div class=&quot;column&quot;&gt;

    &lt;figure class=&quot;post-image medium&quot;&gt;
    
    &lt;figcaption&gt;&lt;a href=&quot;https://www.raspberrypi.org/magpi-issues/MagPi60.pdf#page=30&quot; target=&quot;_blank&quot;&gt;The MagPi, #60&lt;/a&gt;&lt;/figcaption&gt;
    
    &lt;img src=&quot;/images/dist/2017/photo_booth/part0-TheMagPi_60-700w.png&quot; alt=&quot;Photo credit: Jonathan Lang Photography&quot; title=&quot;Photo credit: Jonathan Lang Photography&quot; srcset=&quot;/images/dist/2017/photo_booth/part0-TheMagPi_60-700w.png 700w, /images/dist/2017/photo_booth/part0-TheMagPi_60-1400w.png 1400w, /images/dist/2017/photo_booth/part0-TheMagPi_60-2100w.png 2100w&quot; sizes=&quot;
    (min-width: 801px) calc(.6 * 680px),
    (min-width: 710px) calc(.6 * (100vw - 30px)),
    (min-width: 100px) calc(60vw - 30px),
    100vw
&quot; /&gt;
    
&lt;/figure&gt;

  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Thanks to all the above for their support.&lt;/p&gt;

&lt;h2 id=&quot;acknowledgements&quot;&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;I’d also like to thank the following;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The &lt;a href=&quot;https://ballarathackerspace.org.au/&quot; target=&quot;_blank&quot;&gt;Ballarat Hackerspace&lt;/a&gt; (an awesome community) for their ideas and assistance.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.drumminhands.com/2014/06/15/raspberry-pi-photo-booth/&quot; target=&quot;_blank&quot;&gt;DrumminHands’ Photo Booth&lt;/a&gt; which provided inspiration for parts of this build.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;remixes&quot;&gt;Remixes&lt;/h2&gt;
&lt;p&gt;I love hearing from people that have built their own “photo booth” versions;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Eric built &lt;a href=&quot;https://youtu.be/pOE7_-OhYhQ&quot; target=&quot;_blank&quot;&gt;this brilliant photo booth&lt;/a&gt;. His version includes an impressive-looking marquee, a video light, and it writes the photos to a USB stick (if connected).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have you built a photo booth too?&lt;/p&gt;

&lt;p&gt;If so, I’d love to hear from you!&lt;/p&gt;

&lt;p&gt;My email address is in the footer.&lt;/p&gt;

&lt;h2 id=&quot;next-article&quot;&gt;Next article&lt;/h2&gt;
&lt;p&gt;For the &lt;a href=&quot;https://jackbarker.com.au/photo-booth/1&quot;&gt;next article&lt;/a&gt; in this series, I’ll be talking about &lt;strong&gt;the requirements process&lt;/strong&gt; that I went through when planning my photo booth.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jackbarker.com.au/subscribe&quot;&gt;Subscribe&lt;/a&gt; to my blog to stay informed of my progress.&lt;/p&gt;
</description>
        <pubDate>Mon, 01 May 2017 00:00:00 +0000</pubDate>
        <link>https://jackbarker.com.au/photo-booth/</link>
        <guid isPermaLink="true">https://jackbarker.com.au/photo-booth/</guid>
        
        <category>Raspberry Pi</category>
        
        <category>hacks</category>
        
        
      </item>
    
  </channel>
</rss>
