{"componentChunkName":"component---src-templates-page-js","path":"/notes/announcing-skydesigner-sam-brenner-joins-the-labs/","result":{"data":{"markdownRemark":{"html":"<p>As part of my application for my position at the Cooper Hewitt museum, I built <a href=\"https://collection.cooperhewitt.org/play/skydesigner/\">SkyDesigner</a>, a web application that lets users replace the color of the sky with a picture of a similarly-colored object from the Cooper Hewitt’s collection. The “sky” idea comes from the original assignment, which was to create an application using both a weather API and the <a href=\"https://collection.cooperhewitt.org/api/\">Cooper Hewitt API</a>, but you can use SkyDesigner to swap out colors from anything you can take a picture of. <a href=\"https://collection.cooperhewitt.org/play/skydesigner/\">Give it a try now</a>!</p>\n<img style=\"width: 50%;\" class=\"alignnone size-full wp-image-2609\" src=\"/img/uploads/2014/05/687474703a2f2f7777772e73616d6a6272656e6e65722e636f6d2f70726f6a656374732f736b792f6c69622f696d672f30312e6a7067.jpg\"  />\n<img style=\"width: 50%;\" class=\"alignnone size-medium wp-image-2610\" src=\"/img/uploads/2014/05/687474703a2f2f7777772e73616d6a6272656e6e65722e636f6d2f70726f6a656374732f736b792f6c69622f696d672f30322e6a7067.jpg\"  />\n<p>Here’s how it works: first, users take a picture. If they’re on a computer, they can use their webcam. If they’re on a smartphone, they can use the built-in camera. Android users get (in my opinion) the better experience, because Android supports <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Navigator.getUserMedia\">getUserMedia</a> – this means that users can start their camera and take a picture without ever having to leave the application. <a href=\"http://caniuse.com/stream\">iOS doesn’t support getUserMedia</a> yet, so they are sent off to the native iOS camera app to take their picture, which then gets passed back to the browser. Once I receive the picture, I load it into a canvas.</p>\n<p>In the next step, users tap on their picture to select a color. The color’s hex code is sent straight to the Cooper-Hewitt API’s <a href=\"https://collection.cooperhewitt.org/api/methods/cooperhewitt.search.objects\">search</a> method, where I search for similarly-colored objects that have an associated image. While waiting for a response from the API, I also tell the canvas to make every pixel within range of the selected color become <a href=\"http://www.hmp.is.it/creating-chroma-key-effect-html5-canvas/\">transparent</a>. When I get the image back from the API, I load it in behind the canvas and presto! It shows through where the selected color used to be. Finally, the image is titled based on the object’s creator and your current weather information.</p>\n<p>It’s built using HTML, CSS and JavaScript. The original application had PHP to talk to the API but that’s since been ported to JavaScript since I now have the luxury of running the site on the Collections website itself where we have our own built-in API hooks.</p>\n<p>Being a weekend project, there are some missing features – sharing is a big one – but I think it demonstrates the API’s ability to provide fresh, novel ways into a museum’s vast collection. <a href=\"https://collection.cooperhewitt.org/play/skydesigner/\">Here’s the link again</a>, and you can also find the source on <a href=\"https://github.com/sambrenner/skydesigner\">GitHub</a>.</p>","frontmatter":{"path":"/notes/announcing-skydesigner-sam-brenner-joins-the-labs/","title":"Announcing SkyDesigner! Sam Brenner joins the Labs","date":"2014-05-05T14:40:32.000Z","categories":["Cooper Hewitt","Experimental"],"churl":"http://labs.cooperhewitt.org/2015/visual-consistency-tweaking-the-online-collection/","uses":null}}},"pageContext":{"post":true,"prev":{"url":"/notes/soil-as-medium-final-project-proposal-compost-pile-composter/","title":"Soil as Medium final project proposal: Compost pile composter"},"next":{"url":"/notes/soil-as-medium-final/","title":"Soil as Medium: Final"}}}}