<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[VSCO Stories - Medium]]></title>
        <description><![CDATA[VSCO is a creative channel. We build creative tools, spaces, and connections driven by self-expression. Our mission is to help everybody fall in love with their own creativity. Founded in 2011, VSCO is based in Oakland, CA. http://vsco.co - Medium]]></description>
        <link>https://medium.com/vscostories?source=rss----c78bd7abb7c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>VSCO Stories - Medium</title>
            <link>https://medium.com/vscostories?source=rss----c78bd7abb7c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 04:31:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/vscostories" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Updates To The VSCO Studio]]></title>
            <link>https://medium.com/vscostories/updates-to-the-vsco-studio-180f20125189?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/180f20125189</guid>
            <category><![CDATA[vsco]]></category>
            <category><![CDATA[photography]]></category>
            <category><![CDATA[editing]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[VSCO Stories]]></dc:creator>
            <pubDate>Tue, 21 Jun 2022 18:42:18 GMT</pubDate>
            <atom:updated>2022-06-21T19:29:14.995Z</atom:updated>
            <content:encoded><![CDATA[<h3>Updates To The iOS VSCO Studio</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aAQhPeVQSkM1yFzye5Gug.jpeg" /></figure><h3>Introduction</h3><p>Today, we’re delighted to launch several updates to the iOS VSCO Studio. We believe that your studio is a consolidation of your creative life — it is your visual supply. Your studio is the place where you curate, edit, revisit and iterate on all of your work. We know that you value the things that you create in VSCO and find value in having them all in one place and have designed the new studio with all of this in mind.</p><h3>VSCO Studio Background</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b6Gbm8yOlu-oaZ6KjJLMpg.jpeg" /></figure><p>From the very beginning of VSCO Cam in 2012 until 2020, VSCO imported images into the app’s Studio by physically copying the image in memory into the app. Originally this was the only way photo apps could work, but over time, users’ libraries grew to massive sizes and caused memory issues that were difficult to solve. Meanwhile, Apple continued to add more ways for apps to interact with media in the Camera Roll, to the point where physical copies were no longer necessary.</p><p>Thus, in 2020, we made the change to anchor the iOS VSCO Studio on the Camera Roll. This offered several advantages:</p><ol><li>No more duplicate copies of images in the VSCO app. Everything is referenced to the Camera Roll.</li><li>No more losing images in VSCO since everything’s safely backed up in Apple Photos.</li><li>Video editing becomes viable since we’re not duplicating videos on people’s devices.</li><li>No more importing, just open your Camera Roll in VSCO and get straight to editing.</li></ol><p>While much was gained with this new system, through user research and feedback, we began to hear from people that much was also lost, primarily around #4. The Camera Roll, full of the chaos of life, is cluttered and uninspiring; even disorienting and stressful. People missed the VSCO Studio, full of their best work, their works in progress… their space. As we listened to them talk about their process and workflow, it was clear that the Camera Roll focus in VSCO was not entirely serving their needs.</p><h3>Focused on your work with drafts</h3><p>Today, we believe we’ve combined the best aspects of the previous importing model with the tremendous advantages of the Camera Roll model into a new hybrid. Rather than building around your entire Camera Roll, this new studio is a place where you curate, edit, revisit, and iterate on all of your work through drafts. It’s the consolidation of your creative life.</p><h3>Here’s how it works:</h3><ul><li>Editing starts with the new + button, which creates a draft in the VSCO Studio of the selected media.</li><li>A draft in VSCO is the record of your work <em>on</em> that file in VSCO, but the file still lives in your Camera Roll.</li><li>You only see the drafts you’ve created in the VSCO Studio. The Camera Roll is the storage container where you create drafts <em>from</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q7hA8joh4dnTh3CT38H5og.jpeg" /><figcaption><em>The process of creating drafts in VSCO from Camera Roll to Studio.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5QF6jHDfeG7QNcvgMDQybg.jpeg" /><figcaption>VSCO Drafts are linked to originals in the Camera Roll.</figcaption></figure><p>It’s important to note: <strong>if you delete an image in your Camera Roll that you made a draft with in VSCO, that draft will be deleted, since the original media still lives in the Camera Roll!</strong></p><h3>Better starting points</h3><p>The header of the Studio now contains the + button we just spoke about, as well as useful starting points for Montage, Collage and the Camera. Previously, the only way to make a mixed media creation was to select media and then choose one of these options, which makes suggesting helpful templates impractical. You can still start this way, but if you know you want to create a Montage or Collage, you can now use these starting points to access helpful templates and a numbered media selection tool to help with sequencing a Montage. (Read about the updates to Collage and Montage <a href="https://vscostories.medium.com/collage-on-vsco-c621366fe16e?source=friends_link&amp;sk=4d08ee698af2eb036ad03e29f3ce0dc4">HERE</a>)</p><h3>Odds and ends</h3><p>It’s no secret that design is crucially important at VSCO, and we can’t finish without mentioning the thoughtful changes included here from the design team.</p><ul><li>Full-bleed media<br>– Thumbnails now reach all the way to the edges of the screen for larger thumbnails that put more focus on your work</li><li>Numbered media selection <br>– All media selection in the studio now shows a number, indicating 2 things: how many items are selected, and what order they are selected in.<br>– Montage will lay out media according to their selected order, so this is particularly useful if you start a Montage this way.</li></ul><h3>Looking forward</h3><p>While we’re proud of this next step in the evolution of VSCO, there’s still work to do. While the images in the Camera Roll are safe, Drafts in VSCO (as in, your edits) are not, and we are working on a solution to this. <strong>Be sure to make a backup of your phone before you get a new one or reset your current one so that you can fully recover your VSCO studio.</strong> See <a href="https://support.vsco.co/hc/en-us/articles/202904440-How-do-I-create-a-backup-and-restore-from-a-back-up-">this support article</a> for more information.</p><p>In the meantime, we hope that the VSCO Studio is a more creative, inspiring, productive place for your work and process with this new design. As always, we’d love to hear from you about the new studio in our <a href="https://discord.gg/hMA9ebDp">Discord server</a>, the <a href="https://support.vsco.co/hc/en-us/community/topics/360001754192-Feature-Requests">Feature Requests forum</a>, and on social media.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=180f20125189" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/updates-to-the-vsco-studio-180f20125189">Updates To The VSCO Studio</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collage on VSCO]]></title>
            <link>https://medium.com/vscostories/collage-on-vsco-c621366fe16e?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/c621366fe16e</guid>
            <category><![CDATA[collage]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[vsco]]></category>
            <category><![CDATA[art]]></category>
            <category><![CDATA[photography]]></category>
            <dc:creator><![CDATA[VSCO Stories]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 22:14:14 GMT</pubDate>
            <atom:updated>2022-05-17T17:41:35.144Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*abUXc94QJ4_qEMDRnzsTZQ.jpeg" /></figure><h3>Introduction</h3><p>Today, we’re pleased to announce the release of our Collage tool in VSCO, as we work to refine and focus multimedia creation across the platform. While the concept of collage has become quite familiar in recent years, the art form has a rich history and is capable of great creative expression beyond what you may be aware of. In this article, we’ll mine those depths and explore the powerful tool that is Collage.</p><h3>What is Collage?</h3><p>The word “collage” comes from the French word “coller”, which is a verb that means “to stick” or “to glue”. Exact definitions of collage are elusive since it can encapsulate so many things, but very broadly it refers to combinations of various things to create something new. A collage can be just about anything; even music can be a collage. In the visual arts, where it’s most commonly used, it usually refers to the combination of different types of materials or media in a work, but it can also include repeated usage of the same piece of media within a work as in <a href="https://en.wikipedia.org/wiki/Andy_Warhol">Andy Warhol</a>’s <a href="https://en.wikipedia.org/wiki/Marilyn_Diptych"><em>Marilyn Diptych</em></a>.</p><p>The earliest known use of collage is thought to be in China around 200 BC, but it wasn’t widely used until the 10th century by Japanese calligraphers. However, it wasn’t until the early 20th century that collage as we label it today began with <a href="https://en.wikipedia.org/wiki/Georges_Braque">Georges Braque</a> and <a href="https://en.wikipedia.org/wiki/Pablo_Picasso">Pablo Picasso</a>, who had recently co-invented <a href="https://en.wikipedia.org/wiki/Cubism">Cubism</a>. During this time, printed images were becoming more widely available, enabling artists to repurpose them in ways that weren’t practical before. As Braque and Picasso explored shape and form through Cubism, creating shapes and forms with mixtures of media was a natural progression. Braques <a href="https://en.wikipedia.org/wiki/Fruit_Dish_and_Glass"><em>Fruit Dish and Glass</em></a> is among the earliest of their Cubist collages, and inspired the beginning of <a href="https://www.pablo-ruiz-picasso.net/collage.php">Picasso’s many collage works</a>.</p><p>Though Braque and Picasso are credited with the beginnings of collage, many artists from various styles and disciplines used it to great effect from then until now, including <a href="https://en.wikipedia.org/wiki/Dada">Dadaists</a>, <a href="https://en.wikipedia.org/wiki/Surrealism">Surrealists</a>, <a href="https://en.wikipedia.org/wiki/Henri_Matisse">Matisse</a> with his famous <a href="https://www.matissepaintings.org/cut-outs/">cut-outs</a>, <a href="https://en.wikipedia.org/wiki/Pop_art">Pop artists</a>, protest artists, and many more. Even a high-level tour of this history is more than we can get into here, but be sure to check out some of these articles to learn more:</p><ul><li><a href="https://www.theartstory.org/definition/collage/history-and-concepts/">https://www.theartstory.org/definition/collage/history-and-concepts/</a></li><li><a href="https://www.artspace.com/magazine/art_101/art_market/art_101_collage-5622">https://www.artspace.com/magazine/art_101/art_market/art_101_collage-5622</a></li><li><a href="https://artincontext.org/collage-art/">https://artincontext.org/collage-art/</a></li><li><a href="https://www.nytimes.com/interactive/2021/01/29/arts/design/juan-gris-cubism-collage.html">https://www.nytimes.com/interactive/2021/01/29/arts/design/juan-gris-cubism-collage.html</a></li><li><a href="https://en.wikipedia.org/wiki/Collage">https://en.wikipedia.org/wiki/Collage</a></li></ul><h3>Collage on VSCO</h3><p>As technology has improved and magazine cutouts have given way to digital assemblage, collage has become a mainstay in our modern culture, especially with the rise of multimedia creation on mobile devices. At VSCO, we’ve been investing in the power of mixed media since the launch of <a href="https://vscopress.co/vsco-blog/2020/3/4/introducing-montage-first-ever-multimedia-creation-tool-on-vsco">Montage</a> in 2020, and we’re excited to refine our tools further with our latest updates.</p><h4>Here is what’s changed:</h4><ol><li>Collage now exists as a separate mode from Montage. It includes all of Montage’s capabilities, but removes the timeline aspect, freeing up more screen real estate for nuanced editing. It also elevates templates for better inspiration and starting points.</li><li>Montage now defaults to full-screen, sequenced media to better utilize the time dimension of this tool. You can still use it to create collages, but it makes the creation of multi-clip video, photo dumps, and slideshows easier by default.</li><li>The studio now has a top bar with starting points for Collage and Montage (as well as the camera). Rather than requiring you to choose your media first, these new starting points will guide you through the creation process more easily.<br>– Collage will open up the template picker where you can choose from a variety of creative layouts to fill in with your own images.<br>– Montage will open a sequenced media picker, helping you to determine the order of your media as you choose it.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0E4X40CdWiUqVlFJwYZQbw.jpeg" /><figcaption><em>Template selection from the Collage starting point (no image selected)</em></figcaption></figure><h4>Collage tool basics</h4><p>Focusing in on the Collage tool, many images can be loaded into the tool and each one can be resized, repositioned, and rotated through two-finger pinch gestures. Additionally, images can be resized and reshaped through the circular handles that appear on them when selected. While moving images, a grid appears to help with alignment across the composition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iV4GEUaGeVTi29dWXzgVIA.jpeg" /></figure><h4>Default Menu</h4><p>In the default menu (with nothing selected), the Canvas (background) color can be changed, additional media can be added, and various shapes can be added into the collage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zKt5Zx8ep1XiblXptq04jg.jpeg" /></figure><h4>Selection Options</h4><p>When an item in a collage is selected, the selection menu appears. Here, individual elements can be edited in a wide range of ways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MGaZVAK16bll5e0knFer-A.jpeg" /></figure><p><strong>Here’s what each option does:</strong></p><ul><li>Edit: (Image only) Opens the selected image into the image editor</li><li>Replace: (Image only) Opens the media picker to replace the selected image with another</li><li>Modify: (Shape only) Opens the shape menu to change the selected shape</li><li>Copy: Copies the selection, enabling a new “Paste” option from the default menu to add more copies of the selection..</li><li>Opacity: Adjusts the opacity, or transparency of the selection.</li><li>Backward: Moves the selection backward in the stack of images, so that it falls behind an overlapping image.</li><li>Forward: Moves the selection forward in the stack of images, so that it stands in front of an overlapping image.</li><li>Flip: (Image only) Flips the image vertically, so that what’s on the bottom is on top, and vica versa.</li><li>Mirror: (Image only) Mirrors the image so that what’s on the left is on the bottom, and vica versa.</li><li>Delete: Deletes the selection from the collage (but does not delete it from your library).</li></ul><p>Through the creative use of these tools, a deep palette of options is available to you, but it can be daunting to get started. With that in mind, let’s explore some tips and tricks to create great collages on VSCO.</p><h3>Making a Great Collage on VSCO</h3><h4>Images</h4><p>First off, let’s explore some of the ways images can be combined to create a collage.</p><p><strong>1. Use multiples of one image</strong></p><p>To get started, let’s take just one image and make something interesting out of it. By repeating the image with variations, we can create all kinds of interesting outputs with a single image, much like Warhol’s <em>Marilyn Diptych</em> mentioned above. The image can be flipped, mirrored, recolored, blended, or even just stacked in an interesting way to create something engaging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ID6EjfppJS8fcQwGR3Jt6w.jpeg" /><figcaption>Left: <a href="https://vsco.co/ckjoh/gallery">ckjoh</a></figcaption></figure><p>Additionally, a single image can be edited in multiple ways while remaining a single image in appearance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lId8WEs9JNTN3Y0LWw7GIw.jpeg" /><figcaption>Middle: <a href="https://vsco.co/12amsunshine/gallery">12amsunshine</a>, Right: <a href="https://vsco.co/neeeeeeeesh/gallery">neeeeeeeesh</a></figcaption></figure><p><strong>2. Use similar images</strong></p><p>Bringing similar images together is a common use of collage, and can be used to tell stories or emphasize a particular feature of a set of images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4WQ9c9Hsl_PEbJqkpw5OqA.jpeg" /><figcaption>Middle: -<a href="https://vsco.co/-trevor/gallery">trevor</a>, Right: <a href="https://vsco.co/kylehale/gallery">kylehale</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dV9bMh-ajAicLcTm6WVVrw.jpeg" /><figcaption>Left: <a href="https://vsco.co/-krismendoza/gallery">krismendoza,</a> Middle: <a href="https://vsco.co/rollinglemondonut/gallery">rollinglemondonut</a>, Right: <a href="https://vsco.co/sshiohara/gallery">sshiohara</a></figcaption></figure><p><strong>3. Juxtaposition of contrasting images</strong></p><p>Combining seemingly unrelated, or even opposing images can be a very powerful tactic in collage creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hh5ZnQAuduj0YaiWnmTw3w.jpeg" /><figcaption>Middle: <a href="https://vsco.co/12amsunshine/gallery">12amsunshine</a></figcaption></figure><p>(It’s worth noting as well that a double exposure effect can easily be created this way using the opacity tool.)</p><p><strong>4. Continuing lines across images</strong></p><p>A less-used trick is to create forced continuity between images, such as continuing a line or object between them</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k_X3Q16cuFHCo4hv5Ix27g.jpeg" /><figcaption>Middle: <a href="https://vsco.co/-krismendoza/gallery">krismendoza</a>, Right: <a href="https://vsco.co/12amsunshine/gallery">12amsunshine</a></figcaption></figure><h4>Shapes &amp; Colors</h4><p>Now, let’s look at how shapes, colors, and gels can elevate collage, or even be the entirety of it.</p><p><strong>1. Analogous or Complementary Colors</strong></p><p>Though a white or black background is absolutely classic, a colored background can interact with the colors in an image in powerful ways. By choosing a similar colored (analogous) background to a color in the image, that color becomes emphasized even more. By choosing a complementary color (opposite side of the color wheel) for your background, you can add a dynamic color relationship to an image and transform its impact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7CuctCVDclKdn5axsly79A.jpeg" /><figcaption>Middle: <a href="https://vsco.co/ulm3/gallery">ulm3</a>, Right: <a href="https://vsco.co/katyento/gallery">katyento</a></figcaption></figure><p><strong>2. Shapes as gel overlay (part or entire image)</strong></p><p>Overlaying colors in the form of shapes pays homage to the collage art form’s roots in combining materials. By placing a shape over an image (or another shape!) and adjusting the opacity, a color gel effect can be achieved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NsBwPrNxHXZPfYGbUFdU3w.jpeg" /><figcaption>Left: <a href="https://vsco.co/ehidiamen/gallery">ehidiamen</a>, Middle: <a href="https://vsco.co/ulm3/gallery">ulm3</a>, Right: <a href="https://vsco.co/sshiohara/gallery">sshiohara</a></figcaption></figure><p><strong>3. Shapes as design elements / solid or gel</strong></p><p>Shapes are the foundation of design, and they can be combined to great effect in the Collage tool, not just as overlays, but as key design elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iy16a3GM-TJCYOdVsarmpw.jpeg" /><figcaption>Left: <a href="https://vsco.co/pawtuckaway/gallery">pawtuckaway</a>, Middle: <a href="https://vsco.co/ulm3/gallery">ulm3</a>, Right: <a href="https://vsco.co/brentlyjr/gallery">brentlyjr</a></figcaption></figure><p><strong>4. Frames to focus attention on an area of interest</strong></p><p>By swiping over the shapes picker, hollow shapes can be selected, and these can be powerful framing tools to draw attention to various elements in your collage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47808audNejSeSxavOCAgg.jpeg" /><figcaption>Middle: <a href="https://vsco.co/kruser4/gallery">kruser4</a>, Right: <a href="https://vsco.co/ulm3/gallery">ulm3</a></figcaption></figure><p><strong>5. Shapes to add abstraction or obscure part of an image</strong></p><p>Lastly, instead of being graceful companions to your images, shapes can be aggressive abstractors to obscure part of an image for a focused, or even jarring effect. <a href="https://www.google.com/search?q=john+baldessari+dots&amp;newwindow=1&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=2ahUKEwiPsN37ztj3AhUPIjQIHdvZDYwQ_AUoAXoECAIQAw&amp;biw=1792&amp;bih=934&amp;dpr=1">John Baldessari</a> famously used this technique in his work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5i-2gOlUhZ1sPrP4dpJmw.jpeg" /><figcaption>Left: <a href="https://vsco.co/ericwittman/gallery">ericwittman</a>, Right: <a href="https://vsco.co/henrymly/gallery">henrymly</a></figcaption></figure><h4>Hacks!</h4><p>While the Collage tool is already powerful, savvy users have found ways to expand even beyond its current capabilities.</p><p><strong>1. Shapes as shadows</strong></p><p>Credit to <a href="https://vsco.co/-trevor/gallery">Trevor Rosenkilde</a>, a software engineer at VSCO, for this one. First of all, it was discovered that images can be sized down smaller than shapes. To do this, we start by making an all black image to use later.</p><p><strong>Getting a solid color image:</strong></p><ol><li>Open up Collage (however you want to enter).</li><li>Make the canvas blank and pick your color (black is used for this example)</li><li>Save collage</li></ol><p><strong>Drop shadow time:</strong></p><ol><li>Pick your image (ideally an image with an interest point — maybe in the center).</li><li>Expand it to the size you’d like (be careful not to lose your control points off screen — you may need to crop to 9:16 before entering Collage).</li><li>Copy-paste the image.</li><li>Start cropping that newly pasted image to just your interest point. (Careful not to move the duped image. If you do, just delete it and re-copy &amp; paste)</li><li>Copy-paste your newly cropped interest point.</li><li>Move one of the copy-pasted interest point layers to the side and select the old cropped part.</li><li>Hit replace and select the solid color image from earlier.</li><li>Now, move the original cropped interest point slightly to offset it from the now black square/rectangle to make it look like a shadow.</li><li>From here, you’ll want to add the solid color image to the scene and scale it down as small as possible.</li><li>Rotate it 45 degrees and line it up between the corners.</li><li>Copy-paste and do the other side.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*joxq6AMVZVMHIU-H3iQFGQ.jpeg" /><figcaption><a href="https://vsco.co/-trevor/gallery">-trevor</a></figcaption></figure><p><strong>2. Shapes as masks</strong></p><p>Use a black shape to create a mask by overlaying an image over the shape and reducing its opacity to 20%. By doing this, only the areas of the image that overlay the black shapes will be seen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEW73ww6ZVsTGWb3mNr7xw.jpeg" /><figcaption>Left: <a href="https://vsco.co/adabernstein/gallery">adabernstein,</a> Middle: <a href="https://vsco.co/12amsunshine/gallery">12amsunshine</a>, Right: <a href="https://vsco.co/zach/gallery">zach</a></figcaption></figure><h3>Try Collage</h3><p>We hope something in this article has sparked your creativity and gotten you inspired to make your own collage. You can try the Collage tool with a VSCO Membership, or a <a href="https://vs.co/Jg7o/try-a-membership">free 7-day trial</a>.</p><p>If you decide you want to share the images on VSCO, Instagram, or other social channels, use #VSCOCollage so we can see what you create.</p><p>We also invite you to come and discuss collage, or any VSCO feature or topic in our official <a href="https://discord.gg/j8RBNmgavB">VSCO Discord Channel</a>.</p><p><em>All unattributed images created by the VSCO Design team with images licensed from VSCO creators.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c621366fe16e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/collage-on-vsco-c621366fe16e">Collage on VSCO</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dodge & Burn Tool]]></title>
            <link>https://medium.com/vscostories/dodge-burn-tool-ce3da16a2b9e?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/ce3da16a2b9e</guid>
            <category><![CDATA[film]]></category>
            <category><![CDATA[mobile-photography]]></category>
            <category><![CDATA[vsco]]></category>
            <category><![CDATA[darkroom]]></category>
            <category><![CDATA[photography]]></category>
            <dc:creator><![CDATA[VSCO Stories]]></dc:creator>
            <pubDate>Tue, 07 Dec 2021 17:10:47 GMT</pubDate>
            <atom:updated>2021-12-07T17:43:07.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u-Tnlk-zAeCui03Pf6MQZw.gif" /></figure><p>Today, we are excited to launch the new Dodge &amp; Burn tool for creators in the VSCO app. This technique is both powerful and old, dating back far into the history of film photography. In this article, we’ll learn what dodging and burning is, and how to use it both generally, and in the VSCO app.</p><h4>Table of Contents</h4><p>· <a href="#4f7c">What is Dodge &amp; Burn?</a><br> ∘ <a href="#279e">Dodge &amp; Burn in the Darkroom</a><br> ∘ <a href="#6f5c">VSCO’s Dodge &amp; Burn Tool</a><br> ∘ <a href="#795e">Tips &amp; Tricks</a><br>· <a href="#960d">Applying Dodge &amp; Burn</a><br> ∘ <a href="#f61a">Corrective</a><br> ∘ <a href="#edf4">Expressive</a><br>· <a href="#6eca">A Word About Skin Tone &amp; Dodge &amp; Burn</a><br>· <a href="#8109">Try Dodge &amp; Burn</a></p><h3><strong>What is Dodge &amp; Burn?</strong></h3><h4><strong>Summary:</strong></h4><p><em>Dodge &amp; Burn is a technique to control dynamic range in an image. By making dark areas brighter (dodge) and making bright areas darker (burn), a more balanced and pleasing image can be created.</em></p><h4><strong>Dodge &amp; Burn in the Darkroom</strong></h4><p>Historically, Dodge &amp; Burn refers to darkroom practices to control the brightness of areas within an image. It was a very manual, physical, and creative process. Ansel Adams famously<a href="https://youtu.be/IoCtni-WWVs"> elevated this practice to an art unto itself</a> in his landscape images.<a href="https://www.moma.org/collection/works/53904"> Moonrise Over Hernandez</a> is perhaps the most famous example,<a href="https://www.blog.jimdoty.com/?p=15214"> evolving over time through his use of dodge &amp; burn techniques.</a> You can get a glimpse into the depths of his darkroom process in<a href="https://petapixel.com/2016/06/24/making-ansel-adams-famous-image/"> this article</a> and the accompanying video. In many other cases, master darkroom printers like<a href="https://petapixel.com/2013/09/12/marked-photographs-show-iconic-prints-edited-darkroom/"> Magnum Photos’ Pablo Inirio</a> were responsible for fine-tuning many of the most iconic images in history in the darkroom through Dodge &amp; Burn.</p><p>Especially before digital film scanning, prints were the primary photographic medium, and they were created by<a href="https://youtu.be/O31OZgnCoAw?t=168"> shining light through a developed negative onto an undeveloped print</a>. Just as film needs to be exposed properly, prints also need to be exposed properly. Too much light and it comes out too dark; not enough and it’s too light. By placing paper cutouts, cones, or even their hands between the negative and the print, and<a href="https://theliteratelens.files.wordpress.com/2012/02/pablo1copy.jpg"> planning out the exposure times of each part</a>, darkroom printers could mask out areas of the image so that some parts of the print were exposed more or less than others to create a pleasing final image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/0*_GxYkrp2F-9tWoY0" /><figcaption>Dodge &amp; burn in the darkroom.</figcaption></figure><p>“Burn” then refers to <em>more</em> light hitting the print and thus making the areas the light hits darker, while “dodge” refers to <em>less </em>light hitting the print and thus making the areas the light does not hit lighter. You “burn” the light onto the print to make it darker, and you “dodge” the light from hitting the print to make it lighter.</p><p>For an excellent deep-dive into darkroom dodging and burning with some wonderful before and afters, head over to<a href="https://www.35mmc.com/04/05/2020/dodge-burn-and-other-heresies-darkroom-technique-part-5-by-sroyon-mukherjee/"> this article</a> on<a href="http://35mmc.com/"> 35mmc.com</a></p><p><a href="https://www.youtube.com/watch?v=b-keDPtVnGA">This video</a> from Ilford and<a href="https://www.youtube.com/watch?v=aNx66le363g"> this video</a> from Lina Bessonova also demonstrate the process very well through video.</p><h4><strong>VSCO’s Dodge &amp; Burn Tool</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qQ4vXKKd2YRU3ItF" /></figure><p>VSCO’s Dodge &amp; Burn tool consists of 1 new tool that contains 2 tools within it: you guessed it — Dodge &amp; Burn. Each can be brushed in through a single finger gesture on the image. Repeated gestures add more strength to the effect. The tool also has controls for brush size, undo, and redo. Finer control can be achieved by pinching to zoom in closer to the image (note: this is only available on JPEG images and not available on RAW images at this time). Since the brush size stays the same relative to the screen, the precision is increased.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*6b_OLjzt8SBKFER-" /></figure><p>To use, simply select Dodge or Burn, then draw the area on the screen you want to be brighter or darker. To make it more dark or bright, draw again. Keep doing that until you like the result! Be warned: a little bit can go a long way, so don’t overdo it. If you do, use the undo button to step back your brush strokes.</p><p>Use the brush size slider to dial in the size of your brush. In general, it’s best to use the biggest brush you can in order to get natural-looking results. For more fine-tuned jobs, use a smaller brush, and pinch to zoom for ultimate precision.</p><p>To preview the image with and without your Dodge &amp; Burn edits, head over to the history tab and long-press each item in the list to see a preview without it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*1vzQl2hbBEaeWZQs" /><figcaption>Before/After in the Edit History tab.</figcaption></figure><h4><strong>Tips &amp; Tricks</strong></h4><ul><li><strong>Tap the ( i ) next to Dodge &amp; Burn in the toolbar to see a helpful walkthrough any time.</strong></li><li><strong>It’s best to apply Dodge &amp; Burn near the end of your workflow since most filters and many common tools will alter the balance of highlights and shadows.</strong></li><li>In film photography, shadows are harder to recover but highlights can usually be recovered. In digital photography, the opposite is true — shadows are more recoverable but highlights are very fragile. When they’re blown out, there’s nothing left to save with the Burn tool. <a href="https://petapixel.com/2019/05/02/film-vs-digital-this-is-how-dynamic-range-compares/">Here’s a great article that goes into detail on film vs. digital dynamic ranges</a>. <strong>Therefore, it’s best to capture the digital image to protect the highlight information, and then use the Dodge tool to recover the shadows.</strong></li></ul><p><em>A good example of this is capturing an image of the sunset on a digital camera or smart phone. You will want to set your exposure to capture the details of the sunset, and the foreground will typically be underexposed. You can then dodge the foreground to make it lighter, thus creating a balanced, dynamic image.</em></p><ul><li>Use the biggest brush size possible for natural-looking results.</li><li>Pinch-to-zoom for greater precision beyond the smallest brush size.</li><li>Each time you touch the image, you are adding more of whichever mode is selected — Dodge or Burn.<strong> To avoid blotchy results, keep your finger down and brush in the entire area you want the change to be applied to before releasing your finger.</strong> To add more effect, repeat the same gesture again.</li><li>Use the edit history tab to see before and afters with Dodge and Burn. Scroll down to both Dodge and Burn, then long-press on each to see it with and without your edits.</li><li>A little bit goes a long way! For natural-looking results, don’t overdo it. (But of course, unnatural creative usage is encouraged as well!)</li></ul><h3>Applying Dodge &amp; Burn</h3><p>As with most tools, there are 2 main ways to use Dodge &amp; Burn: <em>correctively</em>, and <em>expressively</em>.</p><h4><strong>Corrective</strong></h4><p>With this approach, the goal is simply to make the image look more like what you saw when the image was captured. The human visual system (your eyes, your brain, and everything in-between) is able to make sense of badly lit scenes in ways that even the most advanced, machine learning-enhanced cameras are not. The result is that it’s often hard to capture a scene in the way that you see it with a camera.</p><p>A typical example of corrective dodge &amp; burn usage is a backlit image, where the subject is in shadow and the background is too bright. By dodging the subject and/or burning the background, a better balance can be achieved so that the subject is more naturally visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*8xQX4MxHsdRtghdR" /><figcaption><em>In the image above, the subject is backlit and in shadow, especially after the L9 filter is applied. By dodging the shadow areas around the subject and burning the sky and reflections, the image is greatly improved.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*FX-WA_R_Nti_Pmzp" /><figcaption><em>In the image above, we have a moody dusk scene with interesting details that disappear with the KC25 filter applied. By dodging the shadow areas and burning the sky, the original balance is preserved with the great colors of the filter.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*84cIDVprsQ_OEKoo" /><figcaption><em>In the image above, the building is lacking detail and the orange glasswork is buried in shadow. By burning the sky, and then the building itself, contrast is increased and its details become more visible. By dodging the glasswork, the vivid colors and details are restored.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*N8VIO5HZq3T4cn9u" /><figcaption><em>In the image above, the broken tree in the foreground is very dark and the background is a bit bright, drawing attention away from the tree. By dodging the broken tree and burning the receding forest, the viewer’s eye is drawn to the tree and the overall mood of the image becomes more subdued.</em></figcaption></figure><h4><strong>Expressive</strong></h4><p>With this approach, the goal is more about refining the impact of an image to achieve your expressive goals. <strong>When we look at an image, our eyes are primarily drawn to 2 things: brightness and contrast.</strong> (And color, but this tool doesn’t deal with that) By subtly brightening and darkening different portions of the image, the viewer’s gaze can be guided and the visual impact can be enhanced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*fSx7C4VH15FRrXN7nG09Tw.gif" /><figcaption><em>In the image above, the brightest parts of the image rob attention from the focal points, which are the people and the city skyline. By burning the sky and concrete around the people, the people and the skyline stand out more. By dodging the character in the middle, we bring more attention to them, drawing the viewer in to imagine themselves there.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*6h5Do69GcdLUT757" /><figcaption><em>In the image above, the small person to the left is perhaps the most interesting part of the image, but attention is robbed by the concrete in the foreground. By burning this area and dodging the person, they become more of a focal point. Then, by dodging the street in the distance we give more depth to the image by giving the viewer a place to look out into the distance.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*pDarUyWikiEPClUh" /><figcaption><em>In the image above, the dog in the window is clearly the focal point, but it’s a little hard to pick out with several other white elements in the scene. By darkening the whole image with exposure and then burning the area around the dog, the contrast around the dog is increased and the viewer’s eye is drawn to it more easily. In this case, since the dog is already white, dodging wouldn’t be as effective as burning the surrounding areas.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*4wSA6kJPX9zjLBcS" /><figcaption><em>In the image above, the sky lacks detail once the AU5 filter is applied, and the subject doesn’t quite stand out enough. By burning the sky and the mountains around the subject, the sky details are restored and the subject stands out against the background better. By further burning the foreground and zooming in to dodge the subject, the emphasis on the subject is further enhanced.</em></figcaption></figure><h3><strong>A Word About Skin Tone &amp; Dodge &amp; Burn</strong></h3><p>Skin tone in photography is a challenging topic, both technically and socially, and we just can’t get into it fully here. <strong>However, it’s important to understand that using Dodge &amp; Burn in an attempt to <em>change</em> skin tone is a damaging practice to both yourself and others.</strong></p><p>Unfortunately, the line between innocent, corrective usage, and unhealthy beauty enhancement is blurry. As we mentioned above, cameras are still no match for the human visual system. Thus, there are practical situations where brightening or darkening a person in an image is easily justifiable to compensate between what the camera captured and what you saw.</p><p>However, when you don’t <em>like</em> what you see in an image of yourself or someone else that looks natural, it’s important to ask yourself why, and tread carefully with tools like Dodge &amp; Burn. You could be imposing several harmful forms of bias upon yourself and others, even unknowingly, by misusing Dodge &amp; Burn to make skin lighter or darker.</p><p>If you are struggling with your own body image, the <a href="https://movemeantfoundation.org/">Movemeant Foundation</a> and <a href="https://thebodypositive.org/">The Body Positive</a> are great resources. If you are struggling with self-harm, or any related mental health issues, <a href="https://support.vsco.co/hc/en-us/articles/213079063-Suicide-and-self-injury-prevention">this support page</a> is a great place to start with helpful resources.</p><h3>Try Dodge &amp; Burn</h3><p>We’ve been thoroughly enjoying learning about and using Dodge &amp; Burn internally, and we’re delighted to make it available to VSCO creators. You can try Dodge &amp; Burn yourself with a VSCO Membership, or a <a href="https://vs.co/Jg7o/try-a-membership">free 7 day trial</a>.</p><p>If you decide you want to share the images on VSCO, Instagram, or other social channels, use #VSCO so we can see what you create.</p><p>We also invite you to come and discuss Dodge &amp; Burn, or any VSCO feature or topic in our official <a href="https://discord.gg/j8RBNmgavB">VSCO Discord Channel</a>.</p><p><em>All images by Zach Hodges.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce3da16a2b9e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/dodge-burn-tool-ce3da16a2b9e">Dodge &amp; Burn Tool</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VSCO Film X & The Imaging Lab]]></title>
            <link>https://medium.com/vscostories/vsco-film-x-the-imaging-lab-619b50aeffb0?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/619b50aeffb0</guid>
            <category><![CDATA[imaging]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[film]]></category>
            <category><![CDATA[photography]]></category>
            <dc:creator><![CDATA[VSCO Stories]]></dc:creator>
            <pubDate>Thu, 03 Dec 2020 23:53:41 GMT</pubDate>
            <atom:updated>2020-12-07T21:13:36.563Z</atom:updated>
            <content:encoded><![CDATA[<p><em>All images by </em><a href="https://vsco.co/zach/gallery"><em>Zach Hodges</em></a><em> &amp; </em><a href="https://iamcartermoore.com/"><em>Carter Moore</em></a><em> unless otherwise noted</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5pDoHpeBeWhfBNXQ" /><figcaption><em>Film measurement log sheet and slides.</em></figcaption></figure><h3>Introduction</h3><p>When you open up the VSCO app and load a photo into the editor, one of the first things you see is filters. The first group has a white background and colored letters, and they are different from all the rest. These are the “Film X” filters. While they look much like the others, these filters are the result of a 4-year labor of love.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4bYcehhTNKkwc7LQ" /><figcaption><em>Film X filters in the VSCO app.</em></figcaption></figure><h4><strong>How it started</strong></h4><p>It all started in 2011 with the original VSCO Film product we released for Adobe Lightroom that launched our company. By the end of 2012, the product’s creator, Zach Hodges, had developed an intense film testing method that delivered good results. However, it was highly labor-intensive, and the result was limited by the platform it was made for — and restricted to it. What’s more, many films were getting hard to find and even what was available was starting to degrade beyond usefulness. That’s when we realized the importance of the measurements we were taking, because we may not get to measure twice.</p><p>For us, that realization felt like an imperative. We wanted to capture as many films as we could before they were gone — and really capture them, so that what we made would be indistinguishable from real film, not just “close enough.” We wanted it to be infinitely reproducible on any software platform, with any camera, at any time. So, we amassed a huge pile of film, put it in a freezer, and got to work researching.</p><h4><strong>There must be a better way</strong></h4><p>Initially, we assumed that someone must have mapped out the look of different films before us. We searched high and low, talking to any expert we could find in search of answers, but every lead turned into a dead end. After some time, we realized we couldn’t bring this vision to life on our own. We understood the general concept of what we wanted to achieve, but it was clear that we were way out of our depth with the science. Fortunately, because of all our searching, we also knew where the answers were: with the color scientists. It turns out that vision is extremely complicated, and therefore reproducing what we see is also extremely complicated. Thus, there’s a whole field of science devoted to it. (You’re experiencing the benefits of it right now reading this screen.)</p><h3><strong>Building a spectral model</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OiM5xy3VnIEVI5bk" /><figcaption><em>Film hanging to dry.</em></figcaption></figure><p>It was 2014 when we started looking for a color scientist, and connected with Rohit Patil. With a graduate degree in Color Science, and a background doing color modeling with other mediums, he was the needle in a haystack we desperately needed. He brought the knowledge we had been missing and a vision for the project soon began to take shape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5YW9nPDBbracWgXK" /><figcaption><em>Rohit Patil during the development of Film X.</em></figcaption></figure><p>We needed to build a physical model of how film responds to wavelengths of light. A “spectral” model, unshackled from any camera, chart, media type, or platform. Such a model would allow us to pass any “light spectrum” through it and get a “film output”. With this kind of a model, we’d be able to do everything we wanted and more. Additionally, any future engineer could use the data to bring the look of film to any future camera or platform. To make this spectral model, we also needed a process that could gather the needed data from a single roll of film, since that was sometimes all we had.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YQ2dcQYdW-IFrrdE" /><figcaption><em>Example of measured spectral sensitivities of color film dyes.</em></figcaption></figure><p>Film is made up of multiple layers that cannot simply be peeled apart, so our first challenge was working out how to measure the separate components of a film. We would have to measure them all at once to document how they all reacted to light. We were going to have to determine the spectral sensitivities of each layer, as well as the spectral properties of the resulting dyes after the film is processed that create the final image. During this time of broad research, it felt like we were grappling in the dark, hoping this would all somehow work.</p><h4><strong>Outfitting the imaging lab</strong></h4><p>As we gathered all of the custom (and expensive) equipment we needed piece by piece, we quickly realized that we needed a place to put it all. (This had all been happening in a dusty storage closet initially.) Luckily, around this same time, VSCO had grown out of its old space, and we were building out a new office in Oakland, California. So, we asked for an imaging lab, and were able to incorporate it into the plan.</p><p>A year later, we finally moved into our beautiful new lab, and it was a massive improvement. The lab is actually 3 rooms: a large, central working area, a film processing (or “wet”) lab, and a black room.</p><p>We needed our own wet lab to get fast and reliable results. Lia Cecaci, from our support team, stepped up originally and got everything up and running, including the arduous fire code compliance. She eventually handed the processing off to Lucciana Caselli, who skillfully handles it now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5xA-OKS8wlOi5fx1" /><figcaption>VSCO’s wet film lab. Image by <a href="https://vsco.co/luccianacaselli/gallery">Lucciana Ceselli</a></figcaption></figure><p>We also built the black room — a special, light-sealed room with non-reflective black walls, ceilings and floors to ensure that our spectral data has no stray light reflections to contaminate the results. This “black box” is where much of the work of exposing and measuring the film happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z3yUBHtt506JGvmh" /><figcaption>The “Black Box” near the end of construction.</figcaption></figure><p>In between the wet lab and black room, there’s a large working area for desks, whiteboards, a couch, scanners, and that same freezer we bought back in 2012, full of about 100 different kinds of film. The room contains several scanners, but the most important are the two old Fuji Frontier units — one plus a backup in case the first one breaks. These have been popular in commercial film labs for digitizing film since the early 2000’s, and are still used by labs to this day as the look they impart on their scans is beloved within the film community.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AQM2a9C6-o7lgMaZ" /><figcaption><em>VSCO Imaging Lab working area. Image by </em><a href="https://vsco.co/luccianacaselli/gallery">Lucciana Ceselli</a><em>.</em></figcaption></figure><p>Once our new lab was up and running, we ran into another problem: Doing the measurements manually was extremely tedious, and the sheer amount of work before us was not practical. We needed an automated measuring system for film, but that didn’t exist. Thankfully, we had recently recruited some interns from the Multimedia and Creative Technologies department at USC. One was Yuan Liu, who was a film fanatic himself. With a background in digital signal processing, image processing and hardware-related programming, Yuan brought all the knowledge we needed to take the next step. He built an Arduino robotic measurement system to help us automate the process of measuring the film with the spectroradiometer to collect the spectral data. The time required to measure each film went from days to hours. He then created our model of the Fuji Frontier scanner, a crucial last piece of the puzzle. Yuan quickly made himself crucial to the project, and ultimately became the fourth member of our Film X Project Team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y6KzQepaQ4OoDTMy" /><figcaption><em>Fuji Frontier Film Scanner. Image by </em><a href="https://vsco.co/luccianacaselli/gallery">Lucciana Ceselli</a>.</figcaption></figure><p>At last, the four of us had the first end-to-end model of a film (Kodak Portra 400) that was somewhat decent, but of course, another big problem became clearer: the application of the model to digital images. Since our model was based on physical light, we needed a way to feed linear raw image data (AKA Scene-referred data) into the model to apply to digital images for accurate results. Thus, we also set out to find a reliable way to control raw rendering, which led us to Apple’s raw framework in OS X. We were able to do what we needed with this, and it became the basis for our testing. At the time, there was nothing like this on any mobile device, so we knew we would need a better solution eventually. But, for the purposes of testing and refining the film model, we pressed on with Apple raw.</p><h4><strong>An interactive film model</strong></h4><p>When we finally got a film model output that we felt was presentable, another big problem presented itself: modeling just one exposure of the film doesn’t come close to capturing the possible looks a photographer can achieve with it. In fact, through under- and overexposure, a single film can deliver a wide range of looks. We realized we needed to model them all. We needed an <em>interactive</em> film model, so we set about adding changes of exposure to our film model, shooting several stops over and under. We call it “character,” since the character of a film changes so much with exposure.</p><p>Once that was complete, we realized that the balance between the three color channels (red, green, blue, or RGB) changed dramatically with exposure. For this reason (and many others), commercial film scanners include controls to balance the three channels for each picture. Since every scene responds a bit differently to the changes in the channel balance, a “one-size-fits-all” setting did not work well. Our film model also needed another level of interaction: “warmth”, which models changes to the scanner model.</p><p>As we drew closer to what we felt was a releasable product, another lucky break rewarded our persistence: Apple was bringing its raw framework to iOS 10! This meant we could bring the full experience of the film model on the raw images to mobile devices in the VSCO app. But this presented one final challenge: the entire infrastructure of the editing portion of the app would have to be rebuilt to support this new functionality. So, we set to work, but we needed the help of our software engineer Jason Gallagher, who believed in the project so much that he literally worked through the weekend to get the whole project over the finish line in time for launch. On December 7th, 2016, Film X finally launched to the public with 5 films.</p><h3><strong>What the process looks like today</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*suHg2Kr_9pK_W1Xu" /><figcaption><em>Scene from the wet film lab.</em></figcaption></figure><p>When Rohit joined the team, we asked for a year to complete the project. The Film X piece ended up taking two years for the negative film, and another six months for positive slide film.</p><p><a href="https://www.wired.com/story/vsco-film-photo-filters/">This Wired article</a> explains it all in more detail, but the basics are that we load each film into our Canon EOS 3 SLR camera with a Zeiss 50mm lens. In the black room, we photograph test charts and scenes that have been specifically selected to include the full range visible light spectrum, color combinations and a variety of skin tones.</p><p>Next, we develop the film in the wet lab, and then put it through the measurement system to measure it, which can take up to 30–40 minutes for each frame of film. Then, we also scan these frames using the Frontier (or other) scanner. All this data then goes to our custom software, which uses a combination of color science, statistics, and machine learning to figure out the spectral properties of the film including dye densities and film spectral sensitivities.</p><p>The result, at long last, is a rigorous spectral model, a digital representation of how film responds to light itself. Point your digital camera at any scene, and the film model can figure out how film would have responded to that same scene. We then turn that result into a filter for the VSCO app.</p><p>At the time of this writing, over 7 years from when we began this project, we have now released 38 Film X filters through this process into this new architecture. We can shoot and import RAW and JPEG files and apply the most accurate, interactive film model ever created to them… on our phones. If anyone out there is half as happy about that as we are, then all this work was worth it.</p><p>The main thing we’re left with is a sense of accomplishment and pride. To our knowledge, no one besides film manufacturers has ever even done this kind of work. We modeled film based on how it reacts to light itself. It was extremely difficult to do, and we’re extremely proud of it. Louis Pasteur said “Fortune favors the prepared mind,” and that feels especially true with this project.</p><p>So next time you open the VSCO app and see those white filters staring back at you, give them a try, and enjoy the fruits of our labor: Film X.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7uPQbKuJDywI6kog" /><figcaption><em>Film freezer full of preserved film.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f_KrCvsKuiW7-HBk" /><figcaption><em>Film scanning.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Hz3sQ6PgP15DrP8" /><figcaption><em>Tools in the film development lab.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gqRaJOpLLkzarvQr" /><figcaption><em>Measuring spectral properties of film.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J0UqKyNmyQOwBMwG" /><figcaption><em>Measuring spectral properties of film.</em></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=619b50aeffb0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/vsco-film-x-the-imaging-lab-619b50aeffb0">VSCO Film X &amp; The Imaging Lab</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Querying S3 Data With Redshift Spectrum]]></title>
            <link>https://medium.com/vscostories/querying-s3-data-with-redshift-spectrum-516442a2a713?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/516442a2a713</guid>
            <category><![CDATA[redshift-spectrum]]></category>
            <category><![CDATA[s3]]></category>
            <dc:creator><![CDATA[VSCO Stories]]></dc:creator>
            <pubDate>Thu, 29 Oct 2020 18:27:43 GMT</pubDate>
            <atom:updated>2020-10-29T20:42:43.814Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Jenn Georgevich</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYs_TRI6P7Ev5jLeGcUQIQ.jpeg" /><figcaption>Image of colorful lights over a subway sign by <a href="https://vsco.co/quijanoflores/media/5f989ab474d0d41b8c6d52fe">Quijano Flores</a></figcaption></figure><p>VSCO uses Amazon Redshift Spectrum with AWS Glue Catalog to query data in S3. This piece describes steps taken to adopt Redshift Spectrum for our primary use case — behavioral events data, lists subsequent use cases, and closes with tips we’ve learned along the way.</p><h3>Behavioral Events Data</h3><p>The first use case focuses on how we updated the transformation and loading of behavioral events for analytics.</p><h4>The Problem</h4><p>In late 2018, VSCO’s behavioral event data was growing quickly. Increased user engagement across VSCO’s mobile and web platforms was great news, but we wanted to limit storage costs for the rising influx of event data. Let’s first overview the data’s upstream origins before describing the transform and load steps of that behavioral events data pipeline.</p><h4>Behavioral Event Origins</h4><p>When people interact with VSCO on our web or mobile platforms, their actions trigger the platforms to record event messages. For example, editing a photo will result in an event message describing which preset was used. The event message is sent to an API that publishes it to a Kafka topic. A consumer reads batches of event messages from the topic and writes them as Apache Parquet files to AWS S3. We call these unprocessed Parquet files “alpha” data.</p><p><strong>Diagram: Behavioral event origins and upstream pipeline</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NEaDUagFm5f9AIZl6_lAGQ.png" /><figcaption>Phones and the VSCO website send behavioral event messages to a Go service. The Go service sends the messages to Kafka topics matching the event types. Spark consumers read from the Kafka topics and write the data to S3 at example prefixes “alpha/event=A” and “alpha/event=B”</figcaption></figure><p>This part of the behavioral events data pipeline continued to serve our needs and was not updated to protect storage costs. The raw “alpha” data remained the source data for both versions of the downstream pipeline.</p><h4>Transform &amp; Load into AWS Redshift</h4><p>Our old pipeline read raw “alpha” data from one AWS S3 location and wrote processed “beta” JSON files to another. The processing step deduplicates events, removes unsupported characters, updates a few field types, and flattens nested fields. From the “beta” S3 location, the JSON data was copied into Amazon Redshift tables. Amazon Redshift served as our analytics database, where Data Scientists and Analysts used the event tables for ad hoc exploration and building downstream tables.</p><p><strong>Diagram: Transform &amp; load to Redshift pipeline</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLLDc7-O0Y7toMioEvMoTQ.png" /><figcaption>Image description: This diagram depicts transform and load steps for an example behavioral event type “A”. A Spark job reads Parquet files from an S3 prefix “alpha/event=A”. It processes the data and writes it as JSON files to S3 prefix “beta/event=A”. Then, the JSON files are inserted into a Redshift table “table_a”. Sometimes, aggregate data from “table_a” is stored in a Redshift table “agg_table_a”.</figcaption></figure><p>Amazon Redshift Storage</p><p>Our Amazon Redshift cluster comprises <a href="https://aws.amazon.com/redshift/pricing/">DC2 nodes</a>, which store data locally for fast performance. Storing all the behavioral events data in the Redshift cluster enabled speedy query responses, at the cost of adding new nodes whenever disk space ran low. We were concerned to see disk space use growing more quickly than our compute needs, especially after we found most behavioral events tables were infrequently queried. Some were used to update downstream tables that tracked company metrics or experiment results in daily or hourly intervals. Many had query logs showing a few ad hoc investigations spread over many weeks. We saw that we should preserve query access to the data, but were paying too high a cost for its storage.</p><p>What if we could query the “beta” data directly instead of storing it all in our AWS Redshift cluster? Storing more data in S3 would cost significantly less than adding more Redshift nodes (see <a href="https://aws.amazon.com/redshift/pricing/">Redshift pricing</a> and <a href="https://aws.amazon.com/s3/pricing/">S3 pricing</a> documentation). We could then reserve Redshift cluster storage for only the most frequently queried data.</p><h3>Solution</h3><h4>Introducing Amazon Redshift Spectrum</h4><p><a href="https://docs.aws.amazon.com/redshift/latest/dg/c-using-spectrum.html">Amazon Redshift Spectrum</a> is a feature of Amazon Redshift that enables us to query data in S3. Our most common use case is querying Parquet files, but Redshift Spectrum is compatible with <a href="https://docs.aws.amazon.com/redshift/latest/dg/c-spectrum-data-files.html">many data formats</a>. The S3 file structures are described as metadata tables in an<a href="https://docs.aws.amazon.com/glue/latest/dg/define-database.html"> AWS Glue Catalog database</a>. Within Redshift, an <a href="https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_SCHEMA.html">external schema is created</a> that references the AWS Glue Catalog database. The external schema provides access to the metadata tables, which are called external tables when used in Redshift. Those external tables can be queried like any other table in Redshift. External tables can even be joined with Redshift tables. The familiar table interface meant introducing Redshift Spectrum would require minimal onboarding for data consumers.</p><p>Diagram: Redshift Spectrum overview</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSwduVI3sEfZJ_ZUMb0qnA.png" /><figcaption>Image description: A user queries Redshift with SQL “SELECT id FROM s.table WHERE date=…”. Redshift is connected to the Redshift Spectrum layer. The Redshift Spectrum layer can access metadata in a Glue Data Catalog as well as files in S3.</figcaption></figure><p>Image description: A user queries Redshift with SQL “SELECT id FROM s.table WHERE date=…”. Redshift is connected to the Redshift Spectrum layer. The Redshift Spectrum layer can access metadata in a Glue Data Catalog as well as files in S3.</p><p>The costs for Redshift Spectrum are determined by the amount of data scanned during queries. If S3 data is in a columnar format (like Apache Parquet files), only the specified columns in a query are scanned. This cost structure is a good fit for infrequently queried historical event data. It encourages us to keep most data in S3 and only promote recent or often-queried data to Redshift cluster storage.</p><h4>Adopting Redshift Spectrum for behavioral events data</h4><p>A few incremental improvements paved the way to our current behavioral events storage solution.</p><p>Updating the “beta” file structure</p><p>Recall Redshift Spectrum scans only the columns needed if the data is in a columnar format. To decrease the data scanned during queries, we converted the “beta” files from JSON to Apache Parquet. We also used snappy compression to reduce the Parquet file sizes. Date partitions were included in the “beta” data S3 prefixes and external tables to limit data scanned.</p><p><strong>Diagram: Using date partitions for Redshift Spectrum</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNnIbujpgxXF-XRd0Iq0OA.png" /><figcaption>This image depicts an example query that includes a “date” partition. A user queries Redshift with SQL “SELECT id FROM s.table_a WHERE date=’2020–01–01’”. The Redshift Spectrum layer receives the query, and looks up the date partition with value ’2020–01–01’ in the Glue Catalog. It gets the S3 location ending in the prefix “beta/event_a/date=2020–01–01”. Then, the Redshift Spectrum layer only scans data in the given S3 location.</figcaption></figure><h4>Permitting querying across AWS accounts</h4><p>Our S3 buckets that house the alpha and beta Parquet files reside in a separate AWS account (Account A) from our AWS Redshift cluster (Account B). This presented a permissions challenge.</p><p>We decided that table metadata should reside in the same account as the data it describes, so Glue databases live in Account A with the S3 data. This gave us the option to move away from Redshift or deprecate Account B in the future while continuing to query our S3 data with <a href="https://aws.amazon.com/athena/">Amazon Athena</a> using the same Glue databases.</p><p>Redshift users query with Redshift Spectrum in Account B. They needed access to the Glue database to read the table’s metadata for the S3 files, and permission to read the files from S3.</p><p><strong>Permissions setup:</strong></p><ol><li>We created an “account-b-redshift” service-linked IAM role in Account B.</li><li>An IAM role “account-a-s3-glue” was created in Account A. We granted the role access to Account A’s Glue database and S3 locations.</li><li>We created a trust relationship allowing the “account-b-redshift” role to assume the “account-a-s3-glue” role.</li></ol><p>After permissions were in place, we tied them together by creating an external schema in Redshift. The external schema chains the roles in the “iam_role” parameter. This allows “account-b-redshift” to assume the “account-a-s3-glue” role whenever a Redshift user queries the external schema.</p><pre>create external schema example_schema from data catalog</pre><pre>database ‘exampledb’ region ‘us-west-2’</pre><pre>iam_role ‘arn:aws:iam::123456789012:role/account-b-redshift,arn:aws:iam::210987654321:role/account-a-s3-glue’;</pre><p>We added a Terraform module and documentation to quickly create new Glue databases, IAM roles, and IAM policies for future cross-account Redshift Spectrum use cases.</p><h3>Results</h3><p><strong>Diagram: Transform &amp; load to Redshift pipeline (before Redshift Spectrum)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLLDc7-O0Y7toMioEvMoTQ.png" /><figcaption>This diagram is a copy of the “Transform &amp; load to Redshift pipeline” from the “Problem” section. For an example behavioral event type, a Spark job reads Parquet files from an “alpha” S3 prefix and writes JSON files to a “beta” S3 prefix. The JSON files are then inserted into a Redshift table.</figcaption></figure><p><strong>Diagram: Querying behavioral events data with Redshift Spectrum</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LpS919qOYrYij46TYBtevw.png" /><figcaption>A Spark job reads Parquet files from S3 prefix “alpha/event=A” and writes processed snappy compressed Parquet files to S3 prefix “beta/event=A”. Files in the “beta/event=A” prefix can be queried using Redshift Spectrum. The step inserting data into Redshift is absent.</figcaption></figure><p>Redshift Spectrum liberated us from depending on the Redshift cluster for data storage. We removed the “load to Redshift” step from our behavioral events pipeline and limited purchasing more nodes for the Redshift cluster. Storing Parquet files in S3 described in a Glue Catalog also gives us the options to use <a href="https://aws.amazon.com/athena/">Amazon Athena</a> for querying and add on more <a href="https://aws.amazon.com/glue/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;whats-new-cards.sort-order=desc">AWS Glue</a> features in the future.</p><h3>Subsequent Redshift Spectrum Use Cases at VSCO</h3><p>Using Redshift Spectrum to query data in S3 helps us make data more accessible, more quickly than before. We no longer have to consider the storage costs of moving data sets into the Redshift cluster to make them queryable. The Data Engineering team now enables query access to S3 <a href="https://docs.aws.amazon.com/redshift/latest/dg/c-spectrum-data-files.html">files in any supported format</a>. This empowers Data Scientists and other data consumers to explore large historical data sets and get earlier insight into new data.</p><p><strong>Queryable logs</strong></p><p>Problem: We needed access to database changelogs for investigations and table replication.</p><p>VSCO developed an in-house service that reads the changelogs from our MongoDB and MySQL tables, writes the logs to Kafka, then stores them in S3 as Parquet files. With Redshift Spectrum, we provided query access to those logs. This has enabled ad hoc exploration of historical data and investigations of anomalies. We also use scheduled queries to update Redshift replications of the MongoDB and MySQL tables.</p><p><strong>Third-party data</strong></p><p>Problem: For each new third-party data source, we created a different process to make the data accessible.</p><p>We now implement a simple pattern for new third-party data sources:</p><ul><li>There is an existing “third-party” S3 bucket and “third-party” Glue database. Existing IAM roles and policies allow Redshift users to read data from the S3 bucket and update tables and partitions in the Glue database.</li><li>Data from a new third-party source is stored in a “third-party” S3 bucket at a prefix like “source_name/raw”</li><li>External tables and partitions for the new data are created for the “source_name/raw” data, giving query access to Data Scientists.</li><li>Processed versions of the third-party data are stored in the “third-party” S3 bucket at prefixes like “source_name/v=[version]”</li><li>External tables and partitions for the new version are created for the “source_name/v=[version]” data, allowing Data Scientists to easily review the changes.</li></ul><p>Immediately after we gain access to a new data source and export it into S3, we can provide query access to the data with Redshift Spectrum. As we process the raw data into different versions (also written to S3 as Parquet files), all versions of the data can be easily queried.</p><p>Benefits:</p><ul><li>Provides quick query access to raw data dumps for Data Scientists. This enables faster iteration and collaboration between the Data Science and Data Engineering teams.</li><li>If desired, raw and processed data can be queried from S3.</li></ul><h3>Tips</h3><p>We compiled these tips based on learnings gained during our implementation:</p><ul><li>If you know the partition values and locations, it is fast and inexpensive to add them using SQL or the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api.html">AWS Glue API</a>. We either run a script to add many partitions at once, or schedule the additions with <a href="https://airflow.apache.org/">Apache Airflow</a> tasks.</li><li><a href="https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html">Glue Crawlers</a> can be defined to periodically crawl through new data and create relevant partitions for you. A crawler processes (and downloads if the data is compressed) all new files to infer their structure. For large data, running the crawlers becomes <a href="https://aws.amazon.com/glue/pricing/">costly</a>.</li><li><a href="https://docs.aws.amazon.com/athena/latest/ug/msck-repair-table.html">“MSCK REPAIR TABLE” in Athena</a> scans a file system (like S3) and adds missing partitions. Running this command repeatedly would keep partitions up to date. However, the <a href="https://docs.aws.amazon.com/athena/latest/ug/msck-repair-table.html">AWS docs note “it is possible it will take some time” and might time out</a>. Many users <a href="https://stackoverflow.com/questions/53667639/what-does-msck-repair-table-do-behind-the-scenes-and-why-its-so-slow">complain</a> <a href="https://stackoverflow.com/questions/44599976/msck-repair-table-table-name-taking-long-time">it</a> <a href="https://stackoverflow.com/questions/45107866/aws-athena-msck-repair-table-takes-too-long-for-a-small-dataset">is</a> <a href="https://athena.guide/articles/msck-repair-table/">slow</a>.</li><li>Values in the raw data may not be queryable by Redshift Spectrum. We ran into <a href="https://docs.aws.amazon.com/redshift/latest/dg/multi-byte-character-load-errors.html">“Multibyte character load errors”</a> before preprocessing the files.</li><li>Use <a href="https://docs.aws.amazon.com/redshift/latest/dg/tutorial-query-nested-data-sqlextensions.html">SQL extensions </a>to query nested data with Redshift Spectrum.</li><li>Use partitions when querying external tables. This limits the data scanned by Redshift Spectrum, thereby keeping costs down.</li><li><a href="https://redshift-immersion.workshop.aws/lab5.html#optimizing-with-partitions">This lab</a> walks through adding partitions and demonstrates their impact on queries.</li></ul><h3>Resources</h3><p>This<a href="https://aws.amazon.com/blogs/big-data/amazon-redshift-spectrum-extends-data-warehousing-out-to-exabytes-no-loading-required/"> AWS Big Data Blog post</a> describes Redshift Spectrum and its benefits in more detail.</p><p>Other helpful links:</p><p><a href="https://docs.aws.amazon.com/glue/latest/dg/define-database.html">AWS docs: Defining a Database in Your Data Catalog</a></p><p><a href="https://aws.amazon.com/redshift/pricing/">Amazon Redshift Pricing</a></p><p><a href="https://aws.amazon.com/s3/pricing/">Amazon S3 Pricing</a></p><p><a href="https://docs.aws.amazon.com/redshift/latest/dg/c-using-spectrum.html">AWS docs: Querying external data using Amazon Redshift Spectrum</a></p><p><a href="https://docs.aws.amazon.com/redshift/latest/dg/c-spectrum-data-files.html">AWS docs: Creating data files for queries in Amazon Redshift Spectrum</a></p><p><a href="https://docs.aws.amazon.com/redshift/latest/mgmt/using-service-linked-roles.html">AWS docs: Using service-linked roles for Amazon Redshift</a></p><p><a href="https://docs.aws.amazon.com/redshift/latest/dg/c-spectrum-iam-policies.html#spectrum-iam-policies-cross-account">AWS docs: Cross-account Amazon S3 permissions</a></p><p><a href="https://aws.amazon.com/premiumsupport/knowledge-center/redshift-cross-account-glue-s3/">AWS knowledge center: Example IAM policies for cross-account access</a></p><p><a href="https://docs.aws.amazon.com/redshift/latest/mgmt/authorizing-redshift-service.html#authorizing-redshift-service-chaining-roles">AWS docs: Chaining IAM roles in Redshift</a></p><p><em>Acknowledgments</em></p><p>Editors: Kevin Johnson, Shruti Sharma, Zach Hodges</p><p>This post summarizes work done across many projects.</p><p>Contributors and advisors for the projects in this post: Atsunori Kakitani, Benji Hertel, Connie Chen, Desiree Cox, Jack Schonbrun, Jennifer Georgevich, Kevin Johnson, Lucas Kacher, Melinda Lu, Ryan Nguyen, Vlad Losev</p><p>If you find this kind of work interesting, <a href="https://vsco.co/about/careers">come join us!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=516442a2a713" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/querying-s3-data-with-redshift-spectrum-516442a2a713">Querying S3 Data With Redshift Spectrum</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using On-Device Machine Learning to Suggest Presets for Images in VSCO]]></title>
            <link>https://medium.com/vscostories/using-on-device-machine-learning-to-suggest-presets-for-images-in-vsco-76c1c7132478?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/76c1c7132478</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[subscription]]></category>
            <category><![CDATA[image-editing]]></category>
            <category><![CDATA[recommendations]]></category>
            <dc:creator><![CDATA[Shruti Sharma]]></dc:creator>
            <pubDate>Sat, 26 Sep 2020 00:14:33 GMT</pubDate>
            <atom:updated>2020-10-19T22:34:41.192Z</atom:updated>
            <content:encoded><![CDATA[<p>At VSCO, we’re using machine learning (ML) in many different ways. One of the most exciting is our latest feature taking advantage of on-device ML: for this photo. It’s a great solution to a complex problem, and it also combines exciting areas of technology for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*MBbPhLJS4iTNWbYxRR-6qw.jpeg" /><figcaption>“For This Photo” feature</figcaption></figure><h3>The Challenge</h3><p>VSCO has a catalog of over 200 presets, which are pre-configured editing adjustments to help our users transform their images. These include emulations of old film camera stock such as <a href="https://eng.vsco.co/reviving-kodachrome/">Kodak Kodachrome 25</a>, Fujifilm Velvia 50, Agfa Ultra 50, and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QW1bAOaGL_TtqI0_tJ7kvA.jpeg" /><figcaption>Image by Sarah Hollander</figcaption></figure><p>With so many presets to choose from, our research suggested members were overwhelmed and stuck to using the few favorites they knew and liked, instead of trying new presets.</p><h3>The Solution</h3><p>Our challenge was to overcome decision fatigue by providing trusted guidance and encouraging discovery, while still leaving space for our users to be creative in how they edit their images. We decided to solve this problem by suggesting presets for images. We developed the “For This Photo” feature, which uses on-device ML to identify what kind of photoa user is editing and then suggest relevant presets from a curated list. The feature has been so loved by our users that “For This Photo” is now the second most used preset category second only to showing all available presets.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfHbjfeitIvE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfHbjfeitIvE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FfHbjfeitIvE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fef04331f8feb74ff59e21fe6fa6d1c/href">https://medium.com/media/8fef04331f8feb74ff59e21fe6fa6d1c/href</a></iframe><p>We decided to use <a href="https://cs231n.github.io/convolutional-networks/">deep convolutional neural network</a> (CNN) models because these models can understand a lot of the nuances in the images, making categorization easier and faster than traditional computer vision algorithms. Our Imaging team thoughtfully curated presets that complement different types of images, allowing us to deliver a personalized recommendation for each photo.</p><p>To understand the flow of how the “For This Photo” feature works when a user starts editing an image, we will walk through the steps that take place:</p><ol><li>When a user loads the image in the Edit View of our photo editor, inference (prediction) via the model is instantly kicked off.</li><li>After inference, the model returns a category for the image, such as “portrait” or “urban”.</li><li>The ID of the image category is then matched with the corresponding ID in the cached catalog which contains a predefined list of presets for each category.</li><li>Six presets are chosen from the list of presets that are retrieved, some of which are available to everyone and some that are available only with a VSCO Membership. These presets end up in the “For this Photo” tray in our photo editor.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QNnflGdOwQ-SBWHbetEj9w.jpeg" /><figcaption>Diagram by Zach Hodges</figcaption></figure><p>Showing free and paid presets is important to us in order to provide value to everyone who uses VSCO, while also demonstrating the value of membership to them. To this end, the presets that are part of VSCO membership can still be previewed by non-members. For members, it has the benefit of educating them on the type of images their member-only presets can be used on.</p><h4>On-device ML ensures accessibility, speed, and privacy</h4><p>From the get-go, we knew server-based machine learning was not an option for this feature. There were three main reasons we wanted this feature to use on-device ML: offline editing, speed, and privacy.</p><p>First, we did not want to limit our members’ creativity by offering this feature only when they were online. Inspiration can strike anywhere — someone could be taking and editing photos with limited network connectivity, in the middle of a desert, or high up on a mountain.</p><p>Second, we wanted to ensure editing would be fast. If we offered “For This Photo” with the ML model in the cloud, we’d have to upload users’ images to categorize them (which takes time, bandwidth, and data), and users would have to download the presets, making the process slow on a good connection and impossible on a poor one. Doing the ML on-device means that everything happens locally, quickly, with no connection required. This is crucial for helping users capture the moment and stay in the creative flow.</p><p>Third, the editing process is private. A server-side solution would require us to upload user photos while the users were still editing them before they published them. We wanted to be cognizant of our users’ privacy in their creative process.</p><h3>Overview of VSCO’s Machine Learning Stack</h3><p>The three main components of our ML tech stack are: <a href="https://www.tensorflow.org/">TensorFlow</a>, <a href="https://spark.apache.org/">Apache Spark</a>, and <a href="https://www.elastic.co/products/elasticsearch">Elasticsearch</a>. We use TensorFlow for deep learning on images, Apache Spark for shallow learning on behavioral data, and Elasticsearch for search and relevance.</p><p>We have a real-time cloud-based inference pipeline using TensorFlow Serving that runs every image uploaded to VSCO through various convolutional neural networks in real-time. The inference results of these models are then used for product features like Related Images, Search, Just For You, and other sections in Discover, etc. For on-device machine learning, we use <a href="https://developers.google.com/ml-kit/">ML Kit </a>+ <a href="https://www.tensorflow.org/lite">TensorFlow Lite</a> on Android and <a href="https://developer.apple.com/machine-learning/core-ml/">Core ML</a> on iOS for on-device inference. We’ll get into the details of this part of our stack in the next section.</p><p>We also have an Apache Spark-based recommendation engine that allows us to train models on large datasets from different sources in our data store: image metadata, behavioral events, and relational data. We then use the results of these models to serve personalized recommendations in various forms, like our User Suggestions feature.</p><p>To power our ML pipeline, we use <a href="https://kafka.apache.org/">Apache Kafka</a> for log-based distributed streaming of data that serves as input for all our ML models, and <a href="https://kubernetes.io/">Kubernetes</a> for deploying all our micro-services. The languages we use include Python, C++, Go, Scala, and for on-device integrations, we use Java/Kotlin and Swift/Obj-C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dTIHI0J9kFDAY3eaONW3FQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjxXb5bKYYv1t4W1-WXsrg.jpeg" /></figure><h3>“For This Photo” — Technical Implementation</h3><h4>Step One: Categorizing Images</h4><p>n order to build a model that serves the “For This Photo” feature, we wanted to be able to first assign a category to the image and then suggest presets that were designed to work well for that category.</p><p>We started with image data tagged by our in-house human curators. These curators are photography experts who have a front-row seat to our user behavior, so they know better than anyone what type of content is being shared and what trends are developing. They helped our engineering team come up with image categories for our model, which include: art, portrait, vibrant, coastal, nature, architecture, light and shadow, monochrome, and many more. As the saying goes, 90% of machine learning is about cleaning up your data. These steps helped take care of making sure the data our model was based on was reliable.</p><p>Using this categorized dataset, we trained a CNN model in TensorFlow based on <a href="https://arxiv.org/abs/1602.07360">SqueezeNet</a> architecture. We chose this architecture because of its smaller size without much loss in accuracy compared to other architectures.</p><p><strong>ML Kit on Android</strong></p><p>Knowing that we wanted to do on-device machine learning with our custom model, TensorFlow Lite was an obvious choice due to the ease of taking a model trained on the server and converting it to a model compatible for a phone (.tflite format) by using the <a href="https://www.tensorflow.org/api_docs/python/tf/lite/TFLiteConverter">TFLiteConverter</a>.</p><p>Also, we had already experienced the success of TensorFlow and TensorFlow Serving in production systems for our server-side ML. TensorFlow’s libraries are designed with running ML in production as a primary focus so we felt TensorFlow Lite will be no different.</p><p>We used <a href="https://developers.google.com/ml-kit/">ML Kit</a> to run inference on a TensorFlow Lite model. ML Kit provided higher-level APIs for us to take care of initializing and loading a model as well as running inference on images without having to deal with the lower level TensorFlow Lite C++ libraries directly. This made the development process much faster and left us with more time to hone our model instead, causing us to take the feature from prototype to production-ready fairly quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*4oyMtdaK4MWX0k4WJPVQ5w.jpeg" /><figcaption>Categorizing an image — Android</figcaption></figure><p>We converted this trained model from TensorFlow’s Saved Model format to TensorFlow Lite (.tflite) format using the<a href="https://www.tensorflow.org/api_docs/python/tf/lite/TFLiteConverter"> TFLiteConverter</a> for use on Android. Some of the causes of our initial bugs in this stage were due to the mismatch in the version of TFLiteConverter we used compared to the version of TensorFlow Lite library that ML Kit had a reference to via Maven. The ML Kit team was very helpful in helping us fix these issues as they came up.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d8e4cc4d45fc39836934bb634b0f91c/href">https://medium.com/media/1d8e4cc4d45fc39836934bb634b0f91c/href</a></iframe><p>Once we had a model that could categorize images, we bundled it into our app and ran inference on images with it pretty easily using ML Kit. Since we were using our own custom trained model, we used<a href="https://firebase.google.com/docs/ml-kit/use-custom-models"> Custom Model API from ML Kit</a>. For better accuracy, we decided to forgo the quantization step in model conversion and use a floating-point model. There were some challenges here because ML Kit assumes a quantized model by default. With a little effort, we changed some of the steps in model initialization to support a floating-point model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/685d8dc355499d2a86f93c2f988af3a9/href">https://medium.com/media/685d8dc355499d2a86f93c2f988af3a9/href</a></iframe><p><strong>Core ML on iOS</strong></p><p>For iOS, Core ML was the obvious choice for on-device ML. It’s been around for a couple years and is a very mature and easy-to-use library. Core ML provides high-level APIs all the way from converting the model to Core ML format to the actual inference on images on-device. While running inference, Core ML allows the app to get the maximum possible performance using the hardware acceleration provided by Apple’s neural engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*9Ef0v8xq8hlWZoCKOuSR5g.jpeg" /><figcaption>Categorizing an image — iOS</figcaption></figure><p>Apple’s<a href="https://github.com/apple/coremltools"> Core ML Tools</a> made it very easy to convert our server-trained model into Core ML (.mlmodel) format. Since this converter supports Keras and Caffe model types but not TensorFlow’s Saved Model type, we decided to use a Caffe model we had trained in the SqueezeNet format. The best part was that this converter even let us specify the channel-wise bias as well as channel order for the input image that the model needed. This made these pre-processing steps part of the converted model; meaning we didn’t have to pre-process the images in our app before feeding them into the model during inference.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb5ee2bef62ab1e24bacc6610c8986c2/href">https://medium.com/media/eb5ee2bef62ab1e24bacc6610c8986c2/href</a></iframe><p>Once we had a model that could assign categories to images, Core ML made it pretty straightforward to bundle this model into our app and run inference on images with it. Adding the model to our Xcode project was as simple as dragging the model into the project navigator. Core ML automatically generates a Swift class that provides easy access to the ML model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba4e5835566458d10dccbd340929d9b8/href">https://medium.com/media/ba4e5835566458d10dccbd340929d9b8/href</a></iframe><h4>Step Two: Suggesting Presets</h4><p>The next challenge was to suggest presets based on these categories of images. We collaborated with our in-house Imaging team who had created these presets to come up with lists of presets that work well for images in each of these categories. This process included rigorous testing on many images in each category (landscape, water, etc.) where we analyzed how each preset affected various colors. In the end, we had a curated catalog with tastefully chosen presets mapped to each category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*JUgav2x03_Dxgf2A6oqfFA.jpeg" /><figcaption>Suggesting presets for an image</figcaption></figure><p>These curated catalogs are ever-evolving as we add new presets to our membership offering. In order to make it easier for us to update these lists on the fly, without the users having to update their app, we decided to store these catalogs on the server and serve them using an API, a microservice written in Go which the mobile clients check-in with periodically to make sure they have the latest version of the catalogs. The mobile clients cache this catalog and only fetch when there is a new version of the catalog available. However, this approach creates a “cold start” problem for users who do not connect to the internet before trying out this feature for the first time, not giving the app an opportunity to connect to the API and download these catalogs. To solve this, we decided to ship a default version of these catalogs with the app. This allows all users to be able to use this feature regardless of their internet connectivity, ensuring one of the original goals of this feature to begin with.</p><h3>Results and Conclusion</h3><p>With “For This Photo”, we accomplished our goal to make editing with presets easier to navigate. We believe that if our members don’t find value in getting new presets, their creative progress is being hindered. We wanted to do better. We wanted to help more users not just discover new presets, but zero in on the presets that best matched what they were working on.</p><p>At VSCO, we’re looking to ML to provide inspiration and trusted guidance. We want to continue to improve “For This Photo” to provide recommendations based on other image characteristics as well as the user’s community actions (e.g. follows, favorites, and reposts). We also want to provide greater context for those recommendations, and to encourage our community of creators to discover and help fuel the creative spark in each other.</p><p><em>Acknowledgments</em></p><p>Many people from multiple teams contributed to the development of this feature — Yuanzhen Li, Melinda Lu, Katherine Pioro, Eric Cheong, Viet Pham, Maggie Carson Jurow, RJ Simonian, Augustine Ortiz, and many others.</p><p>Thanks to Jenny Zheng, Zach Hodges, Lucas Kacher, and Jessica Jiang for copy editing and reviews.</p><p>If you find this kind of work interesting, <a href="https://vsco.co/about/careers">come join us!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76c1c7132478" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/using-on-device-machine-learning-to-suggest-presets-for-images-in-vsco-76c1c7132478">Using On-Device Machine Learning to Suggest Presets for Images in VSCO</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reviving Kodachrome]]></title>
            <link>https://medium.com/vscostories/reviving-kodachrome-b09059b12cb?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/b09059b12cb</guid>
            <category><![CDATA[kodachrome]]></category>
            <category><![CDATA[film]]></category>
            <category><![CDATA[vsco]]></category>
            <dc:creator><![CDATA[VSCO Stories]]></dc:creator>
            <pubDate>Tue, 01 Sep 2020 17:10:00 GMT</pubDate>
            <atom:updated>2020-08-28T18:52:29.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0a-DHY6tgdQmu54uaGswxg.jpeg" /><figcaption><em>Image by </em><a href="https://vsco.co/kylehale/gallery"><em>Kyle Hale</em></a><em>, edited with KC25</em></figcaption></figure><h3>Introduction</h3><p>Since the early days of VSCO, we have loved the look of Kodachrome and have wanted to recreate its inspiring look and feel in digital form. However, the last roll of Kodachrome was processed one year before VSCO started as a company, so it was never possible to shoot and process the film to create an accurate <a href="https://support.vsco.co/hc/en-us/articles/360043269391-Preset-Guide">preset</a> (aka filter). We had made some eyeballed attempts based on historical film scans, but releasing a film preset that wasn’t built from real film didn’t meet our quality standards. Thus, the desire to find a way to create a digital version of Kodachrome from developed Kodachrome film remained dormant in our minds.</p><h3>History</h3><p>Kodachrome was the first consumer color film, and it has a rich history that spanned over the course of the 74 years it was in production. From capturing family road trips in the 50’s, to capturing some of the most iconic global imagery, as seen in the Afghan Girl portrait by Steve McCurry, it’s a film that has stood the test of time. Not only was it the first affordable and readily available consumer color film, it was also the predecessor to all modern day color films, and color photography as we know it. The common practice of recording life moments like birthdays, vacations and graduations with one’s own camera really took off with Kodachrome, leading CNN to call it<a href="https://www.cnn.com/style/article/mid-century-memories-kodachrome/index.html"> “The Instagram of its time.”</a> As recently as 2017, Netflix even released a movie called <a href="https://en.wikipedia.org/wiki/Kodachrome_(film)">Kodachrome</a> whose plot is based on the discontinuation of Kodachrome.</p><p>Not only is Kodachrome film incredibly important from a historical perspective, but also from the perspective of the richness and vibrancy of the colors it produced. From the muted greens and blues to the bold reds and yellows, this film was known for its eye-catching appeal. Mind you, all of this was done chemically, which displays the ingenuity of the chemical and process engineers who developed Kodachrome. We knew that to preserve the legacy and beauty of the film, we had to recreate the look and feel of the film in the digital space so new generations could enjoy the film effects of Kodachrome for years to come.</p><h3>Research</h3><p>In the fall of 2017, with our<a href="https://www.wired.com/story/vsco-film-photo-filters/"> Film X</a> modeling process in place, VSCO’s Imaging team decided it was time to pick up the pursuit of a digital preset inspired by Kodachrome again. The only problem was, Kodachrome film stock had been discontinued in 2009, and K-14, the unique Kodachrome development process handled with proprietary machinery, had been discontinued in 2010. This meant that one could no longer buy the film off the shelves, and there was nowhere to process the film in color. The only options were to purchase expired packs of Kodachrome film on eBay or through online forums, keep it in the freezer for preservation and try to find a way to develop it ourselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mCbcJDztsQloM1Vg" /><figcaption><em>VSCO’s film fridge. Image by</em><a href="https://vsco.co/zach/gallery"><em> Zach Hodges</em></a></figcaption></figure><p>Unlike other film developing processes, Kodachrome was both complex and unique in that it was an additive, color reversal development process as opposed to other simpler film development processes such as C-41 and E6. The process to develop Kodachrome, known as K-14, involved approximately 14 steps to develop the film. This process was comparable to how an inkjet printer applies cyan, yellow, and magenta dyes to a piece of paper to form a final color image. It should be noted that Kodachrome was a B&amp;W film stock, and the color that was added throughout the development process, unlike other color film stocks which have the color dyes already included in the film emulsion. Thus, due to both the complexity and costs of developing Kodachrome as digital photography rose to power, many labs discontinued Kodachrome processing which inevitably led to the end of its production. Other positive slide films such as Fuji Velvia and Kodak Ektachrome (Ektachrome was intended as a replacement for Kodachrome) used the simpler <a href="https://en.wikipedia.org/wiki/E-6_process">E6</a> color reversal process. Nevertheless, the new films couldn’t replicate the colors and depth of Kodachrome and many were unsatisfied with the new alternatives.</p><p>Our Imaging team had begun some preliminary research by poring over blogs, news articles, and forums to find who could develop Kodachrome and where it could be developed. It felt as though almost every stone had been overturned and every door closed as all the replies from film labs and film professionals was <em>Don’t bother trying, Kodachrome is dead.</em> Rather than discouraging us, our interest in solving this intriguing problem only grew.</p><h3>Processing Kodachrome</h3><p>In the end, it took custom-synthesized chemicals, custom-built hardware, and two years to create our own Kodachrome development process that satisfied our high standards for VSCO presets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NgNeUrJf_eudY2vP" /><figcaption><em>Measuring custom chemicals to make cyan, yellow, and magenta developers. Image by</em><a href="https://vsco.co/zach/gallery"><em> Zach Hodges</em></a></figcaption></figure><p>We kept copious logs of our experiments as we slowly improved the process further and further. Progress was slow and tedious, as each run of a small strip of film took hours to process by hand in the dark. Because of the myriad of variables, we were only able to run about 10 tests a week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4rES3zDoMz4lOOTx" /><figcaption><em>Kodachrome developed test strips. Image by </em><a href="https://vsco.co/kylehale/gallery"><em>Kyle Hale</em></a></figcaption></figure><p>As we began the long and winding journey of creating our own development process for Kodachrome, we needed to have a few more controls in place to ensure we were consistent with experimentation. Our color scientist offered his scientific leadership in guiding the team to control the experiments and record and measure results as much as possible. This also led us to work with an in-house hardware/software engineer to automate some of the process for consistency in control variables and better reproducibility in experiments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rwo4WwX63y1GCDPg" /><figcaption><em>Custom hardware built to maintain control variables and increase precision in development. Image by </em><a href="https://vsco.co/zach/gallery"><em>Zach Hodges</em></a></figcaption></figure><p>Our initial results for Kodachrome processing fell flat. We were not achieving good density in the film, which meant the image itself was not very visible and the contrast was extremely low. However, we kept iterating in our experiments and slowly began to see improvements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OWFxwoq4Uau5FU-w" /><figcaption><em>Single dye layer tests. Image by </em><a href="https://vsco.co/luccianacaselli/gallery"><em>Lucciana Caselli</em></a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D06tDeqSRFeJVuTi" /><figcaption><em>Kodachrome after the cyan and yellow layers have been added. Image by </em><a href="https://vsco.co/kylehale/gallery"><em>Kyle Hale</em></a></figcaption></figure><h3>The Challenging Last Mile</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FLQ_-a7XydRlm-jO" /><figcaption><em>Progress and comparisons of VSCO developed Kodachrome test strips. Image by </em><a href="https://vsco.co/kylehale/gallery"><em>Kyle Hale</em></a></figcaption></figure><p>After months and months of iterations in our experiments and roll after roll of Kodachrome developing, we finally achieved results for Kodachrome that we were proud of. We achieved acceptable film density (Dmin and Dmax), acceptable overall color balance, and consistent results on the same batch of film.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hUlQ9-Hzgsk8v3Pc" /><figcaption><em>Verification chart shot on Kodachrome. Image by </em><a href="https://vsco.co/kylehale/gallery"><em>Kyle Hale</em></a></figcaption></figure><p>Since we were now able to successfully process Kodachrome, we then decided to measure and process the film in our existing Film X process for slide films to create a Film X preset. However, once we were able to create a successful digital model of Kodachrome and apply it to real images, it was clear we were still not done. While all the colors were present in the digital model, there were some adjustments needed to be made to ensure the color accuracy was similar to Kodachrome slides that were developed using the K-14 process. Thankfully, we are also well-versed in digital color editing, and we were able to make modifications to fix contrast and color channel balance.</p><h3>Introducing KC25</h3><p>After 10 years since the last roll of Kodachrome was processed, we are delighted to release <a href="https://vsco.co/vsco/journal/introducing-kc25">KC25</a>, our homage to the inspiring legacy of Kodachrome. We hope you enjoyed following this story as much as we loved being a part of it. We also hope that you enjoy using the KC25 preset in the VSCO app, which is included with VSCO membership and can be tried for free for 7 days.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b09059b12cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/reviving-kodachrome-b09059b12cb">Reviving Kodachrome</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C++ Toolchains in Bazel]]></title>
            <link>https://medium.com/vscostories/c-toolchains-4fa4582e6bfa?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/4fa4582e6bfa</guid>
            <category><![CDATA[tensorflow]]></category>
            <dc:creator><![CDATA[Rob]]></dc:creator>
            <pubDate>Thu, 03 Aug 2017 23:22:31 GMT</pubDate>
            <atom:updated>2017-08-08T00:47:13.068Z</atom:updated>
            <content:encoded><![CDATA[<p>At <a href="https://vsco.co/">VSCO</a>, we’ve had great success with the <a href="https://bazel.build/">Bazel</a> build system. We use it to build Go, Java, Python, Rust, and C++ projects. Overall, our experience has been pretty smooth, but we have had some problems with its C++ toolchain. By default, Bazel searches the local machine for an appropriate compiler, and what it finds can vary from machine to machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*cA_AcbotaKk1eVdEHG68yQ.jpeg" /><figcaption>VSCO photo by <a href="http://vsco.co/thatkat/media/5635ac24b39bb85d66c55ac5">thatkat</a></figcaption></figure><p>To provide a smoother experience for our developers, we’ve chosen to leverage <a href="https://chromium.org/">Chromium</a>’s copies of <a href="https://llvm.org/">LLVM</a> and various Linux tools to ensure a consistent environment for our Bazel builds. We’re successfully compiling open source projects like <a href="https://www.tensorflow.org/">TensorFlow</a>, <a href="https://tensorflow.github.io/serving/">TensorFlow Serving</a>, <a href="http://nginx.org/">nginx</a>, <a href="https://github.com/google/googletest">Google Test</a>, and <a href="https://github.com/talebook/statsd-client-cpp">statsd</a>, as well as our own internal code.</p><p>Today, we’re making these Bazel tools available to everyone. Check it out on Github: <a href="https://github.com/vsco/bazel-toolchains">https://github.com/vsco/bazel-toolchains</a>.</p><p>Thanks to Lucas Kacher and Melinda Lu for reviewing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fa4582e6bfa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/c-toolchains-4fa4582e6bfa">C++ Toolchains in Bazel</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling Elasticsearch for Discovery at VSCO]]></title>
            <link>https://medium.com/vscostories/scaling-elasticsearch-for-discovery-at-vsco-51aa60aac15e?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/51aa60aac15e</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[vsco]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Lucas Kacher]]></dc:creator>
            <pubDate>Wed, 19 Jul 2017 21:29:57 GMT</pubDate>
            <atom:updated>2017-07-19T21:29:57.026Z</atom:updated>
            <content:encoded><![CDATA[<h4>From internal tool to image discovery platform</h4><p>By <a href="https://medium.com/u/dda22a218b6f">Lucas Kacher</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iv2s8KeuUECD1TOHbpQ63w.jpeg" /><figcaption><a href="http://vsco.co/benceszemerey">VSCO Photo by benceszemerey</a></figcaption></figure><p>Search at VSCO has transformed from a way to locate users and order history to a full-fledged image discovery system. In early 2013, we needed a way to find users who had registered to purchase VSCO Film on our website. The quickest way to solve this then was to perform queries across our MySQL user and order tables—and while not a scalable approach, it initially got the job done.</p><p>As we continued to grow and develop new products and services, it was no longer feasible to perform queries across growing relational databases with any sort of scale. In late 2013 we began exploring the use of Elasticsearch to:</p><ul><li>Improve our internal admin user search</li><li>Allow for public search of profiles and images</li></ul><p>To tackle this we launched a single Elasticsearch 0.90 instance and ingested data with post-write calls from our monolithic PHP application. We walked our databases and hit the ground running. This allowed us to launch our first public Elasticsearch product, <a href="http://vsco.co/about/press/map-and-image-search">Map, Image and Grid Search</a>, in February 2014.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhjhLw79o7OEJQfiUBnFmA.png" /><figcaption>First iteration of VSCO search service (skulls by <a href="https://twitter.com/skewleft">@skewleft</a>)</figcaption></figure><p>This was an avenue to surface the most influential content on our platform in a way that would inspire our users to both continue to discover new content and continue to create on VSCO. All of the content we featured in search was hand-selected by our in-house curation team, and at the end of our initial cluster’s life, the instance was only serving somewhere in the neighborhood of 500K images.</p><h3>Initial Problems</h3><p>By late 2015 we looked back on our initial foray into Elasticsearch, and while it had treated us well (all on a single instance), we came up with a list of pain points and things we wanted to improve:</p><ul><li>Keeping distributed data in-sync and de-normalized can be difficult without a solid ingestion pipeline.</li><li>Not providing strict index schema or having a migration plan was problematic with our rapidly increasing feature-set.</li><li>Not defining service-boundaries or enforcing contracts leads to tight coupling.</li></ul><p>Looking at our initial problems, and considering our growing product needs, we knew we needed to build a cluster that could handle a <em>lot</em> more data and provide strict ingestion and access patterns.</p><p>In order to take Search to the next level, we needed to ensure that our search service could meet the following criteria:</p><ul><li>Continue to support internal Admin search.</li><li>Ensure <em>all</em> user generated content is ingested into the search cluster.</li><li>Allow us to run on easily scalable, cost-efficient infrastructure.</li><li>Allow us to monitor search from all aspects, including: ingestion, indexing, searching and general cluster health.</li><li>Abstract reads/writes to an independent application layer to enforce service-boundaries.</li><li>Allow for service interruptions to indexing that would prevent lost updates.</li><li>Allow for maintenance windows that do not jeopardize items making it into search or partial availability of search results.</li><li>Enable simple incremental upgrades.</li></ul><p>Initially we looked into converting our standalone instance into a larger cluster with sharding and replication, but it turned out to be an impossible task due to the following:</p><ul><li>We didn’t have a way to take the cluster offline without downtime.</li><li>Elasticsearch <em>0.90</em> was severely out of date at the time.</li></ul><p>In 2015 there were only a few options for a self-hosted, scalable search experience. Due to our previous, mostly positive, experience with Elasticsearch and all of the new features added from <a href="https://www.elastic.co/blog/elasticsearch-2-0-0-released">0.90–2.x</a> we decided that it was a good fit for our needs moving forward.</p><h3>The Next Phase</h3><p>We decided the best way forward was to design and build a brand new Elasticsearch cluster alongside our legacy 0.90 instance. This allowed us to remain entirely online during the migration and provided us a way to start fresh without any of the baggage of the past.</p><p>Our current solution architecture is a combination of Amazon Elasticache, SQS, Docker, Elasticsearch, Go, gRPC and Protocol Buffers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZK6uSD-QMHj4RLaQmIo_sw.png" /><figcaption>VSCO search service today</figcaption></figure><p>All of the following is in service of our goal to get <em>all user content indexed</em>, and here are the details on how we did that.</p><h4>Scalability</h4><p>We built a custom Elasticsearch Docker image that we run on AWS hardware using EBS-backed storage. We allocate and manage infrastructure using Terraform and provision the base instance dependencies using Chef.</p><p>We have independent scaling around all of our Elasticsearch nodes and Go services:</p><ul><li>3 Master Nodes</li><li>3 Client Nodes</li><li>30 Data Nodes (and growing)</li><li>Search Service</li><li>Ingestion Service</li><li>Indexing Service</li></ul><h4>Service Boundary Abstraction (Go Services)</h4><p>In our initial Elasticsearch deployment, it wasn’t feasible to define service boundaries. During the initial phases of deconstructing our PHP monolith, services that needed access to search could not shoulder the overhead of performing requests to our PHP monolith. To get around this latency issue they would access the cluster directly.</p><p>To regain control over our search cluster, we needed our service layer to be scalable and performant. We wrote three independent Go services that would control the abstraction necessary for others to communicate with our Elasticsearch data.</p><h4>Ingestion Service (Go)</h4><p>Leveraging the work we have done for <a href="https://medium.com/vscoengineering/grpc-at-vsco-25fdd57c4aa6">gRPC @VSCO</a>, we were able to easily build, deploy and implement a robust ingestion pipeline that relied on gRPC and protocol buffers to ensure coherent communication between our monolith and the new search services we built to replace parts of it.</p><p>Rather than define a new schema for our search data, as we had done in the past, we defined protocol buffers to model our user data at the service level and we ingest the same protocol buffers that the services use to define their models.</p><p>We ingest our data through updates sent over gRPC to a Go Ingestion Service from our monolithic PHP application and Core API replacement microservices. The service places the item(s) as protocol buffers on an SQS Queue for processing individually or in bulk.</p><p>We use retries in the case of ingestion service interruptions and we backfill to address missing data due to upstream provider issues.</p><h4>Indexing Service (Go)</h4><p>One of the most important problems we set out to solve was dropped inserts and updates from our applications to Elasticsearch. By fronting our indexing service with an Amazon SQS queue, we now have the ability to disable indexing at any time and not lose incoming documents / updates.</p><p>Based upon the incoming item data-type, we query Elasticsearch for a matching document. If found, updates are merged in (if they pass validation) and then persisted back to Elasticsearch. If the change requires a fanout of de-normalized data, items are added back to the SQS queue to be processed in the background.</p><p>We throttle/stop indexing through our <a href="https://github.com/vsco/dcdr">DCDR</a> feature-flag framework.</p><h4>Search Service (Go)</h4><p>We built a Search Service that provides our only access point for performing reads on the cluster. This allows us to disable endpoints, throttle endpoints, provide public or private access to specific endpoints, and stat and monitor everything.</p><p>Our mobile and web clients communicate directly with our Search Service, bypassing legacy routing through our monolith. Our Admin communicates with the Search Service over gRPC, and provides access to the now larger store of user data, helping our Support team find users on the platform.</p><h4>Migration Framework (Go)</h4><p>In a world where settings and schemas are created and applied via HTTP requests, we decided it was important to define a structured way to manage cluster state.</p><p>Based upon concepts from Ruby’s Rake and Doctrine’s Migration Framework, we built a system to handle schema changes and migrations programmatically. <em>All</em> of the changes we have historically made to the cluster are defined in migration files and their status is maintained in a state-store.</p><h4>Federation</h4><p>Out of the box Elasticsearch does not have authorization or authentication for HTTP requests. In order to work towards our service-boundary ideals, we put our new Elasticsearch cluster in a separate AWS Security Group with only the Search and Indexing Services being provided explicit access.</p><h4>Maintenance / Upgrades</h4><p>We designed our cluster with the ability to allow for rolling upgrades without any downtime by leveraging sharded indexes and replication across multiple AWS availability zones.</p><p>This is possible partly through the use of <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html">index aliases</a> to read/write all data to and from the cluster.</p><p>For example: start with a <em>foo_v1</em> index and create <em>foo_read</em> and <em>foo_write </em>aliases that point to the <em>foo_v1 </em>index<em>.</em> Your application should use <em>foo_read</em> as its read path and <em>foo_write</em> as the write.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnOvHNTv8wls6E3rOqcOdg.png" /></figure><p>When the <em>foo_v1 </em>index grows too large or you need to make a material change to the mappings add a <em>foo_v2</em> index and then update the read / write aliases as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o6zWANcftHUblfENDk1eQg.png" /></figure><p>This performs the following function:</p><ul><li>All new writes will fill the <em>foo_v2</em> index</li><li>All reads will look across both indices</li></ul><p>By operating in this manner, we can modify the pointer for the underlying index(es) opaquely to any application logic which makes it possible to modify mappings or scale without requiring application changes or deploys.</p><h3>Achievements / Future</h3><p>Four years ago we could only dream of the Elasticsearch cluster we operate today. Now as we move towards even larger audiences, we can ensure that their content is all discoverable on the platform. In the end, what did we achieve?</p><p>We are now running an Elasticsearch cluster that:</p><ul><li>Handles 25MM read and 5MM index requests per day.</li><li>Maintains an over-1,000X increase of stored documents and counting.</li><li>Can easily scale any part of the infrastructure on-demand.</li></ul><p>In addition to our ability to scale and maintain a large cluster, the ownership of Search and Discovery has moved to the Machine Learning team where we have been able to build many cool features leveraging search including:</p><ul><li>Using our <a href="https://www.fastcompany.com/40428527/vsco-is-teaching-computers-to-interpret-photos-like-a-human">Ava</a> technology to augment image search</li><li>Trending hashtags</li><li>Related images</li><li>Using search to easily prototype new recommendation services</li></ul><p>I look forward to VSCO’s future with Elasticsearch and specifically the replacement of our Ingestion Service with a Kafka pipeline. This will allow us to:</p><ul><li>Remove blocking RPC updates</li><li>Easily re-index from a given point in time</li><li>Maintain a truly up-to-date caching layer</li><li>Move to true immutable infrastructure for search which will allow us to maintain full availability during any maintenance windows.</li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51aa60aac15e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/scaling-elasticsearch-for-discovery-at-vsco-51aa60aac15e">Scaling Elasticsearch for Discovery at VSCO</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Domino — Typesafe DynamoDB DSL for Go]]></title>
            <link>https://medium.com/vscostories/domino-typesafe-dynamodb-dsl-for-go-5562368e8151?source=rss----c78bd7abb7c---4</link>
            <guid isPermaLink="false">https://medium.com/p/5562368e8151</guid>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[vsco]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Naveen Gattu]]></dc:creator>
            <pubDate>Thu, 13 Jul 2017 20:08:34 GMT</pubDate>
            <atom:updated>2017-07-13T21:35:23.900Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPj10pMljuVsdOTB7EH3Uw.jpeg" /><figcaption><a href="http://vsco.co/em_w/media/585bffe071f8fb7f08addc34">VSCO Photo by em_w</a></figcaption></figure><p>DynamoDB… that wildly popular AWS NoSQL database with all the bells and whistles used by companies large and small, offers high performance, low maintenance and flexible pricing. I love it, <a href="https://syslog.ravelin.com/you-probably-shouldnt-use-dynamodb-89143c1287ca">some hate it</a>, others can’t live without it. If you know what you’re getting yourself into, however, it can be a very useful backing store for large quantities of data (you really just need to ensure your access patterns are well distributed across your key space). But when it comes to using the AWS (probably auto-generated) <a href="https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/">APIs</a>, specifically for Go, frustration levels start to spike and productivity undoubtedly declines. Lets take a peek at a non-trivial example:</p><pre>sess := session.New(config)<br>dynamo := dynamodb.New(sess)</pre><pre>input := &amp;dynamodb.QueryInput{}</pre><pre>keyCondition := &quot;locale = :locale&quot;</pre><pre>filterExpr := &quot;email IN (:email1, :email2, :email3) AND size(visits) &lt; :visits AND registrationDate &gt; :regDate&quot;</pre><pre>regDate := time.Now().Format(time.RFC3339)</pre><pre>exprAttrValues := map[string]*dynamodb.AttributeValue{<br>  &quot;:locale&quot;: (&amp;dynamodb.AttributeValue{}).SetS(&quot;<a href="/service/mailto:elon@tesla.com">u</a>s&quot;),<br>  &quot;:email1&quot;: (&amp;dynamodb.AttributeValue{}).SetS(&quot;<a href="/service/mailto:elon@tesla.com">elon@tesla.com</a>&quot;),<br>  &quot;:email2&quot;: (&amp;dynamodb.AttributeValue{}).SetS(&quot;<a href="/service/mailto:page@google.com">page@google.com</a>&quot;),<br>  &quot;:email3&quot;: (&amp;dynamodb.AttributeValue{}).SetS(&quot;<a href="/service/mailto:bezos@worlddomination.com">bezos@</a>pwnworld.co&quot;),<br>  &quot;:visits&quot;: (&amp;dynamodb.AttributeValue{}).SetN(&quot;5&quot;),<br>  &quot;:regDate&quot;: (&amp;dynamodb.AttributeValue{}).SetS(regDate),<br>}</pre><pre>input.SetTableName(&quot;users&quot;)<br>input.SetKeyConditionExpression(keyCondition)<br>input.SetExpressionAttributeValues(exprAttrValues)<br>input.SetConsistentRead(true)<br>input.SetFilterExpression(filterExpr)<br>input.SetIndexName(&quot;locale_index&quot;)</pre><pre>out, err := db.QueryWithContext(context.Background(), input)<br>if err != nil {<br>    return err<br>}</pre><pre>//Collect results<br>var users []*User<br>for _, av := range out.Items {<br>  user := &amp;User{}<br>  if err = dynamodbattribute.UnmarshalMap(av, user); err != nil {<br>     return err<br>  }<br>  users = append(users, user)<br>}</pre><p>In this example we want to perform a query on our users table looking for a specific set of users, filtering out those that have visited 5 times or less and registered after the specified date. We also specify an index to use using a raw string.</p><p>Besides being highly verbose and requiring a lot of boilerplate for a single query, it is <a href="https://smartflow.wordpress.com/2015/04/20/code-smell-stringly-typed/">string-ly typed</a> with respect to the specified columns within the condition query, filter expression and the expression attribute value map declaration. These issues force the programmer (and peer reviewers) to visually verify the types of the index and table keys against what is defined in DynamoDB via the web console. Worse yet, the fields defined in the filter expression are not statically defined at all, since DynamoDB is a NoSQL database. This means that types are determined after a field is set for the first time, as in MongoDB. Furthermore, the query, and filter expressions are untyped strings themselves which can also be a source of bugs. So unless you have extremely well-documented code and don’t mind code repetition and mental variable tracking, this is at the very least very annoying. And we haven’t even considered issues that will arise during refactoring.</p><p>The first step in making this better of course is to use constants to centralize the names of the table columns:</p><pre>const(<br>     usersTable      = &quot;users&quot;<br>     localeField     = &quot;locale&quot;<br>     emailField      = &quot;email&quot;<br>     visitsField     = &quot;visits&quot;<br>     regDateField    = &quot;registrationDate&quot;<br>     localeIndex     = &quot;locale_index&quot;<br>)</pre><pre>keyCondition := localeField + &quot;= :locale&quot;<br>filterExpr   := emailField + &quot; IN (:email1, :email2, :email3)&quot; +   &quot;visits + &quot; &lt; :visits AND &quot; + regDateField+&quot; &gt; :regDate&quot;</pre><p>Certainly this is better but it doesn’t go far enough. How can we be sure that the visits field holds a number that can be compared or that it holds a number at all? How can we be sure that visits is even a field within the users table? How do we ensure that those expression variables (:email1, :email2, …) are accounted for in the expression attribute value map?</p><p>Go is a strongly typed language and types are clearly better for server side programming. Why not leverage its type checker? We can start by defining types for DynamoDB tables, fields and indices.</p><pre>type (<br>    dynamoStringField  string<br>    dynamoNumericField string<br>    dynamoIndex        string<br>)</pre><pre>type dynamoTable struct {<br>    localeField  dynamoStringField<br>    emailField   dynamoStringField<br>    visitsField  dynamoNumericField<br>    regDateField dynamoStringField<br>    localeIndex  dynamoIndex<br>}</pre><pre>table := dynamoTable {<br>    localeField  := dynamoStringField(&quot;locale&quot;)<br>    emailField   := dynamoStringField(&quot;email&quot;)<br>    visitsField  := dynamoNumericField(&quot;visits&quot;)<br>    regDateField := dynamoStringField(&quot;registrationDate&quot;)<br>    localeIndex  := dynamoIndex(&quot;locale_index&quot;)<br>}</pre><p>Excellent! Now we have a static schema for our table defined in code, and <a href="https://www.martinfowler.com/bliki/CodeAsDocumentation.html">readable code really is the best documentation</a>. We can continue declaring types to represent equivalent <a href="https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/#AttributeValue">DynamoDB types</a>, along with methods to further restrict what operations are possible against which types (think comparison operators against numeric values).</p><p>This idea, taken to its logical conclusion is the idea behind <a href="https://github.com/vsco/domino">Domino</a>, a library developed at <a href="http://vsco.co/">VSCO</a> to improve developer productivity when using DynamoDB. Domino allows us to write our table schema definitions once in code, and then utilize a very expressive DSL to construct query, filter, and key condition expressions. Lets take a look at our previous example and define a static schema for the users table:</p><pre>import (<br>     &quot;github.com/vsco/domino&quot;<br>     &quot;github.com/aws/aws-sdk-go/service/dynamodb&quot;<br>     &quot;github.com/aws/aws-sdk-go/aws/session&quot;<br>)</pre><pre>sess := session.New(config)<br>dynamo := dynamodb.New(sess)</pre><pre>//Statically defined table schema<br>type UserTable struct {<br>   domino.DynamoTable   // Composed with a DynamoTable<br>   Locale        domino.String<br>   UserId        domino.Numeric   <br>   Email         domino.String<br>   Visits        domino.NumericSet<br>   RegDate       domino.String //ISO 8601 format</pre><pre>   LocaleIndex    domino.GlobalSecondaryIndex<br>}</pre><pre>// Declare the locale index<br>localeIndex := domino.GlobalSecondaryIndex{<br>   Name:         &quot;locale-index&quot;,  <br>   PartitionKey: domino.String(&quot;locale&quot;),<br>}</pre><pre>table := UserTable {<br>   DynamoTable: domino.DynamoTable {<br>       Name: &quot;users&quot;,<br>       PartitionKey: domino.NumericField(&quot;id&quot;)<br>       GlobalSecondaryIndexes: []domino.GlobalSecondaryIndex{<br>           localeIndex,<br>       }<br>   },<br>   UserId:      domino.NumericField(&quot;id&quot;),<br>   Email:       domino.StringField(&quot;email&quot;),<br>   Visits:      domino.NumericSetField(&quot;visits&quot;),<br>   RegDate:     domino.StringField(&quot;registrationDate&quot;),<br>   LocaleIndex: localeIndex,<br>}</pre><p>And now lets utilize the expression DSL to construct our condition and filter expressions:</p><pre><br>keyCondition := table.Locale.Equals(&quot;us&quot;)</pre><pre>filterExp := domino.And(<br>      table.Email.In(<br>          &quot;<a href="/service/mailto:elon@tesla.com">elon@tesla.com</a>&quot;,<br>          &quot;<a href="/service/mailto:page@google.com">page@google.com</a>&quot;,<br>          &quot;<a href="/service/mailto:bezos@worlddomination.com">bezos@</a>pwnworld.co&quot;,<br>      ),<br>      table.Visits.Size(&quot;&lt;&quot;, 5),<br>      table.RegDate.GreaterThan(time.Now().Format(time.RFC3339)),<br>)</pre><pre>query := table.<br>         Query(keyCondition).<br>         SetFilterExpression(filterExp).<br>         SetConsistentRead(true).<br>         SetGlobalIndex(table.LocaleIndex)</pre><pre>//ExecuteWith accepts a context and dynamo instance<br>results := query.ExecuteWith(context.Background(), dynamo) </pre><pre>//Check for error<br>if err := results.Error(); err != nil {<br>    return err<br>}</pre><pre>//Fetch results from the Results object by iterating over<br>//returned rows, calling the passed in closure which <br>//collects and returns user objects<br>users := []*User{}<br>results.Results(func() interface{} {<br>    r := &amp;User{}<br>    users = append(users, r)<br>    return r<br> })</pre><p>The DSL allows for concise and legible expressions, and exposes methods that are appropriate for each field type. Numeric comparison operators for numeric fields and string comparison operators for strings, in addition to collection operations for set, list and map types. All <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html">condition and filter expressions</a> are supported.</p><p>Lets take another example, this time updating the Visits field:</p><pre>yesterday := time.Now().Add(-1 * time.Day).Unix()<br>results := table.<br>           UpdateItem(domino.KeyValue{123, nil}).<br>           SetUpdateExpression(<br>                 table.Visits.AddInteger(time.Now().Unix()),<br>           ).<br>           SetConditionExpression(<br>                 table.RegDate.GreaterThan(yesterday),<br>           ).<br>           ReturnAllOld().<br>           ExecuteWith(context.Background(), dynamo)</pre><pre>if err := results.Error(); err != nil {<br>    return err<br>}</pre><pre>oldItem := &amp;User{}<br>results.Result(oldItem)<br>    </pre><p>In this example, we update a user row by inserting a visit timestamp into the Visits field only if they have registered since yesterday, returning all the old values from the row. (Note: this is a toy example, you should never insert elements into a set ad infinitum without capping the size somehow).</p><p>Domino supports all DynamoDB operations including support for streaming and paging rows of queried and scanned data using go channels. Please give <a href="https://github.com/vsco/domino">Domino</a> a try and tell us what you think! And if writing high performance server code with cutting edge tech is your thing feel free to reach out, we’re <a href="http://vsco.co/about/careers">hiring</a>! naveen@vsco.co</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5562368e8151" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vscostories/domino-typesafe-dynamodb-dsl-for-go-5562368e8151">Domino — Typesafe DynamoDB DSL for Go</a> was originally published in <a href="https://medium.com/vscostories">VSCO Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>