<?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[IMG.LY - Medium]]></title>
        <description><![CDATA[Stories from the team that builds CreativeEditor SDK. - Medium]]></description>
        <link>https://medium.com/imgly?source=rss----b4d208c80bdd---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>IMG.LY - Medium</title>
            <link>https://medium.com/imgly?source=rss----b4d208c80bdd---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:59:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/imgly" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Create custom variable SF Symbols in Figma]]></title>
            <link>https://medium.com/imgly/create-custom-variable-sf-symbols-in-figma-3ac29a046c52?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ac29a046c52</guid>
            <category><![CDATA[figma-plugin]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[icons]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[sf-symbols]]></category>
            <dc:creator><![CDATA[Dustin Kummer]]></dc:creator>
            <pubDate>Tue, 27 May 2025 07:02:33 GMT</pubDate>
            <atom:updated>2025-10-06T21:28:13.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Q5rWEdVEuxNUN_3bwEkmw.png" /></figure><p>Since its debut in 2019, <a href="https://developer.apple.com/videos/play/wwdc2019/206/#:~:text=SF%20Symbols%20introduces%20a%20comprehensive,for%20multiple%20weights%20and%20sizes.">SF Symbols</a> has revolutionized the way Apple developers and designers incorporate icons into their UIs. With a vast and ever-growing collection (currently over 6,000 icons in <a href="https://developer.apple.com/sf-symbols/">version 6</a>), Apple has streamlined the process of finding the perfect symbol for most design needs.</p><p>However, there are times when the default SF Symbols just don’t cut it. Perhaps your app has specialized functionalities, or you want a unique icon that aligns perfectly with your brand. So, what are your options? You could browse through the endless sea of icon marketplaces and Figma plugins, or you could take the creative route and design your own custom variable SF Symbol.</p><h3>What Are Variable SF Symbols?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*ga0u1heAqEYjOwuIFMkSJQ.gif" /><figcaption>SF Symbols from Ultra Light to Black.</figcaption></figure><p>Variable SF Symbols are an advanced feature of Apple’s SF Symbols. They allow icons to dynamically adapt to different weights, styles, or even data, making them highly versatile for modern interfaces. This flexibility ensures that the icons remain visually consistent across various contexts, whether in light or bold text or at small or large scales.</p><p>Creating variable SF Symbols for all weights involves interpolating between three “master” designs: <strong>Ultra Thin</strong>, <strong>Regular</strong>, and <strong>Black</strong>. Each master serves as a reference point, with smooth transitions calculated between them, much like variable fonts. While the concept is straightforward, the execution requires precise control over design and alignment to ensure seamless results across the weights.</p><h3>A Better Way to Approach the Task</h3><p>To address these challenges, I developed a Figma plugin called <br><a href="https://www.figma.com/community/plugin/1487107089082698461/sf-symbol-generator"><strong>SF Symbol Generator</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4PpxGtVPgNizdN8JikNbwQ.png" /><figcaption>Generate static or variable SF Symbols in Figma with the <strong>SF Symbol Generator</strong> Plugin.</figcaption></figure><p>This tool simplifies the process, enabling designers to focus on creativity rather than getting bogged down by technical constraints. Initially created to streamline my own workflow, the plugin has since become an invaluable tool.</p><p>It highlights key aspects of your designs to help ensure everything is set up correctly for interpolation to work:</p><ul><li>Node count for every path of each weight</li><li>Animated dashed lines to show path direction</li><li>Markers indicating the first node of each path</li></ul><blockquote>SF Symbols works like a variable font, where you choose a specific weight to cater to your requirements, and we will be able to create all weights — from Ultra Light to Black — with the Figma plugin.</blockquote><p>While the workflow isn’t perfect and occasional hiccups can occur, the plugin significantly reduces the previously mentioned frustrating aspects of creating variable SF Symbols. I’m actively exploring ways to refine it further in future updates. Even in its current state, however, it has made the process far more manageable and approachable.</p><h3>Two Approaches to Creating Custom SF Symbols</h3><p>When it comes to creating custom variable SF Symbols, there are two main approaches:</p><ol><li><strong>Create your own Symbol from scratch.</strong></li><li><strong>Base your Symbol on an existing one from the SF Symbols app.</strong></li></ol><p>In the following sections, we’ll first walk through the process of creating a Symbol from scratch.</p><p>For both approaches, it’s recommended to download the <a href="https://developer.apple.com/sf-symbols/">SF Symbols app</a>. This app will be essential for testing and refining your custom symbol to ensure it meets the necessary specifications.</p><h3>Also, keep the following tips in mind:</h3><h4>Disable “Snap to pixel grid” in Figma</h4><p>You can work with snapping to the pixel grid turned on, but it is best to turn it off when it comes to more intricate designs (trust me).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*3RtvFewNy9ZqeLLB-2yvag.png" /><figcaption><strong>Snap to pixel grid</strong> is <em>not</em> recommended.</figcaption></figure><h4>Use Boolean Groups as much as possible</h4><p>Instead of outright flattening your strokes, try using boolean groups instead, as it is a good non-destructive practice and the plugin should flatten them temporarily for the export.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYVO-WwGckptH-_eYMbsEw@2x.png" /><figcaption>Use Boolean Operations as much as possible as a non-destructive alternative to flattening your designs</figcaption></figure><h4>Flatten Boolean Groups (optional)</h4><p>If, for any reason, the plugin flattens some weights with the result of having different amount of nodes, then flattening the paths beforehand and manually removing unnecessary nodes is the only way to go.</p><h4>Avoid Figma’s Corner Smoothing</h4><p>Keep it at 0%: Using Corner Smoothing can create inconsistencies in the <br>number of path nodes between weights when flattened,<br>making the paths non-interpolatable.</p><h4>Flatten Your Strokes if They’re Outside a Frame or Boolean Group</h4><p>The plugin won’t automatically flatten strokes unless they’re inside a Boolean Group or Frame. If they’re not, you’ll need to flatten them manually beforehand.</p><h3>Approach 1: Create your Custom Symbol from Scratch in Figma</h3><p><strong>In this example, we’ll create a dual-camera symbol composed of front and back elements, designed to be animatable.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMRbfZYdCmRBgfOXfcOMwQ@2x.png" /><figcaption>Create a dual camera symbol for Ultra Light, Regular, and Black.</figcaption></figure><p>To create variable SF Symbols in Figma, you’ll design three versions of the same icon for specific weights: <strong>Ultra Light</strong>, <strong>Regular</strong>, and <strong>Black</strong>. These designs are then combined using the SF Symbol Generator plugin, which generates an SVG file that can be used directly in your app or further refined in the SF Symbols app.</p><h4>Step 1 — Start with ∞×32px frames</h4><p>After extensive experimentation, I’ve found that a frame size of 32px in height works well, with the width adjustable based on the design requirements, and a safe zone of 4px for padding. Duplicate the frame twice and rename them to “Ultra Light”, “Regular”, and “Black”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYnaYcQnXrK-qY9BU8PM2Q@2x.png" /><figcaption>Set your frame height to 32px, adjust the width as needed for your design, and leave a 4px safe zone for padding.</figcaption></figure><p>It’s worth noting that, much like in type design, SF Symbols don’t need to adhere to a strict 1:1 aspect ratio. They can be as wide as necessary — within reasonable limits — offering us plenty of room for creativity. Each weight can have their own width—usually getting wider from Ultra Light to Black.</p><h4>Step 2 — Design and use center strokes</h4><p>We need to create a base where we change the stroke sizes for the three weights we want to support. The plugin will later create an SVG for us for the SF Symbols App to interpolate between them. It is mostly easiest to start with <strong>Regular</strong> and then duplicate the design in the frame for <strong>Ultra Thin</strong> and <strong>Black</strong> after.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jv0l0hQ-n04ZpTmIXiSuGQ@2x.png" /><figcaption>Duplicate and change strokes and corner radii</figcaption></figure><p><strong>Use these stroke sizes and corner radii for the following weights:</strong></p><pre>             +-------------+---------------+<br>             | <strong>Stroke size</strong> | <strong>Corner radius</strong> |<br>+------------+-------------+---------------+<br>| <strong>Ultra Thin</strong> | 0.8         | 2.5           |<br>|    <strong>Regular</strong> | 2.45        | 3             |<br>|      <strong>Black</strong> | 4.95–3.5    | 3.5           |<br>+------------+-------------+---------------+<br><br>⚠️ <br><em>Avoid using Figma&#39;s Corner Smoothing; keep it at 0%. <br>Using Corner Smoothing can create inconsistencies in the <br>number of path nodes between weights when flattened,<br>making the paths non-interpolatable.</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkaD1V2S-r4td4NrCCfdMA@2x.png" /><figcaption>Use Center Strokes as much as possible.</figcaption></figure><p>If possible, design your outlined designs with center strokes as much as possible, unless you want the shape to intentionally grow inside or outside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfA5CKJnYcbc4Koecfwmrg@2x.png" /><figcaption>Three weights are needed for SF Symbol Generator to interpolate between them.</figcaption></figure><p>Notice that the part “behind” the camera is intentionally left intact. This allows us to finalize the cutout in the SF Symbols App, ensuring it can animate properly if needed.</p><h4>Step 3 — Use the Plugin and export your variable SF Symbol SVG</h4><p>Select your three frames and open the <strong>SF Symbol Generator</strong> plugin. Click “Scan,” and the plugin will detect your designs. Navigate to the “Variable” section and assign your frames to their respective weights (if it hasn’t done so automatically itself). Once assigned, export the file, and the plugin will generate an SVG in your chosen location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*GNbVYMTF9nN81VrgKXT1zQ.gif" /><figcaption>Select your three icons, scan them with the plugin, and export them as a variable SF Symbol.</figcaption></figure><p><strong>🔥 Handling errors<br></strong>Occasionally, Figma may add extra path nodes to rounded corners when flattening strokes. This can result in different node counts between the three weights, which isn’t ideal since all weights need to have the same number of nodes for proper interpolation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*2d10VxvESJDYK0VfVYdBRg.gif" /><figcaption>Sometimes, different corner radii and stroke widths output different amount of path nodes.</figcaption></figure><p>Here are a few ways to fix this issue before using the plugin:</p><ol><li>Adjust the corner radii values for all or specific nodes, then test by rescanning with the plugin.</li><li>Flatten the paths beforehand and remove unnecessary nodes in the rounded corners using the <strong>Pen Tool</strong>. You may need to manually adjust the Bézier curves if the rounded corners don’t look right.</li></ol><p>This process can sometimes feel finicky, and you might notice that in some few cases the node order has changed after editing. To resolve this, I recommend using the <a href="https://www.figma.com/community/plugin/1391765568770221941/vector-path-editor"><strong>Vector Path Editor Plugin</strong></a> in Figma. This tool allows you to select and set the starting point for your paths, ensuring the correct order for interpolation.</p><h4>Step 4 — Refine Your Symbol in the SF Symbols App (Optional)</h4><p>This step is useful if you need to fine-tune your symbol, like creating a precise cutout in the “background.” The SF Symbols App makes these adjustments straightforward.</p><p>Start by dragging your exported SVG into the SF Symbols App. Add new layers as needed and toggle the visibility of subpaths to achieve the desired look. For cutouts, assign the relevant subpath to a layer set as “Erase,” which acts like a boolean operation to remove parts of the design across layers beneath it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*BdSc9WWgv0FZUoi8ad1I_A.gif" /><figcaption>Refine your symbol in the SF Symbols App</figcaption></figure><p>Let’s enhance it further if necessary by assigning a secondary color and place the cutout layers into a group. Grouping the cutout layers can enhance animation quality significantly. Test it out to see the difference when grouped and not grouped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*fJlZ0EaHFEzz-Lnc6NHElw.gif" /><figcaption>Enhance your symbol further by assigning a secondary color and place the cutout layers into a group</figcaption></figure><p>Once you’ve made your adjustments, export the refined symbol <em>(File &gt; Export Symbol…)</em>, and it’s ready for use in your project.</p><h3>Approach 2: Base your Symbol on an existing one</h3><p><strong>Here, we want to use an existing SF Symbol and customize it for your needs in Figma.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FvRC-GPnkyoq4-rcAWjRBg@2x.png" /><figcaption>Customize an existing SF Symbol in Figma</figcaption></figure><h4>Step 1 — Start with ∞×32px frames</h4><p>Start by preparing the frames for <strong>Ultra Light</strong>, <strong>Regular</strong>, and <strong>Black</strong>, just like in the first approach. Create frames with a height of 32px, any width for now, and a safe zone of 4px. Rename them accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYnaYcQnXrK-qY9BU8PM2Q@2x.png" /><figcaption>Set the frame height to 32px, adjust the width to suit your design, and maintain a 4px safe zone for consistency.</figcaption></figure><h4>Step 2 — Bringing an Existing Symbol into Figma</h4><p>Export the symbol you want to customize from the SF Symbols App <em>(File &gt; Export Symbol…)</em>, then drag and drop it directly into Figma.</p><p><strong>To fit the designs into your newly created frames:</strong></p><ol><li>Scale the SVG down by a factor of <strong><em>0.347826087</em></strong> using the <strong>Scale</strong> tool.</li><li>Read the widths from the scaled down symbols and change your frames accordingly.</li><li>Select the groups from the SVG and position them within your frames.</li></ol><p><em>The scaling factor comes from the ‘rough’ height of an SF Symbol (92px), that needs to fit inside our frame height (32px): 32 / 92 = </em><strong><em>0.347826087</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*zO-LbWZcZDoD1E-CtLvPsg.gif" /><figcaption>Import an existing SF Symbol to Figma, scale it, and then position the groups inside your frames.</figcaption></figure><h4>Step 3 — Customize and Export Your Symbol</h4><p>Once you’ve tailored the symbol to fit your needs, open the <strong>SF Symbol Generator</strong> plugin. Assign your frames to their respective weights, if not done automatically, and export it as a “variable” SF Symbol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*WMxdf-NFng1KN_VfObV78A.gif" /><figcaption>Customize the symbol in Figma and export is via SF Symbol Generator.</figcaption></figure><h4>Step 4 — Refine in the SF Symbols App</h4><p>After exporting, drag your generated SVG into the SF Symbols App. Here, you can make any final adjustments, like hiding subpaths, assigning layers to a specific color, or setting attributes like “Erase” for cutouts. Once refined, you can export it from the SF Symbols App, and your symbol will be ready for use in your project.</p><p>For a more detailed breakdown of what’s possible during refinement, refer to <strong>Step 4</strong> in the first approach. This includes tips on grouping layers, and testing your symbol to ensure it behaves “perfectly”.</p><p>Making custom variable SF Symbols can feel a bit overwhelming at first, but with the right tools and a clear approach, it gets easier and more manageable. Whether you’re starting from scratch or working on an existing design, these steps should help simplify the process and keep things practical.</p><p>Thanks for reading through this guide. If you have any questions or want to share feedback, feel free to get in touch. If you have some direct feedback on the Figma plugin, you can write me some lines <a href="https://www.figma.com/community/plugin/1487107089082698461/sf-symbol-generator">here</a>.</p><p>Good luck and happy designing! 🎉</p><p><em>P.S. We’re currently updating all our custom SF Symbols for our SDK for iOS at </em><a href="https://img.ly/"><em>IMG.LY</em></a><em> with this process. <br>Check out our </em><a href="https://img.ly/blog/building-custom-variable-sf-symbols-in-figma-for-our-creativeeditor-sdk-for-ios/"><em>blog article to learn more</em></a><em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ac29a046c52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/create-custom-variable-sf-symbols-in-figma-3ac29a046c52">Create custom variable SF Symbols in Figma</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IMG.LY Announces Open Source JavaScript Library for In-Browser Background Removal]]></title>
            <link>https://medium.com/imgly/img-ly-announces-open-source-javascript-library-for-in-browser-background-removal-9b19d57358d5?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/9b19d57358d5</guid>
            <category><![CDATA[photo-editor]]></category>
            <category><![CDATA[photo-editing]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Nes Dogan]]></dc:creator>
            <pubDate>Wed, 19 Jul 2023 14:23:14 GMT</pubDate>
            <atom:updated>2023-07-19T14:30:01.144Z</atom:updated>
            <content:encoded><![CDATA[<h4>Seamlessly remove backgrounds in-browser with ease. Empower your creativity and protect data privacy. Learn how!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJsnMEsbAFeNRfwSg_HiRg.jpeg" /><figcaption>This article was originally <a href="https://img.ly/blog/announcing-imgly-background-removal/">published</a> on 28 Jun 2023 by <a href="https://img.ly/blog/author/jan/">Jan Bussieck</a>.</figcaption></figure><p>Just before the summer lull engulfs us all, we have something exciting to share! We are thrilled to announce the release of <a href="https://www.npmjs.com/package/@imgly/background-removal">IMG.LY’s Background Removal</a>, an innovative npm package that empowers developers to seamlessly remove backgrounds from images directly in the browser.</p><p>Gone are the days of relying on server-side processing or sacrificing data privacy. With IMG.LY’s Background Removal, you can now harness the power of in-browser background removal with ease. Let’s dive into the key features that make this library truly exceptional:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*DvjMEA6DXRbt7-p0Hxlw1g.gif" /></figure><h4>In-Browser Background Removal</h4><p>Our one-of-a-kind solution performs the entire background removal process directly in the user’s browser, eliminating the need for additional server costs. By leveraging the computing power of the local device, users can enjoy a fast and efficient background removal process that streamlines their workflow.</p><h4>Data Protection</h4><p>Rest assured that your images and sensitive information remain secure within your own devices. As IMG.LY’s Background Removal runs entirely in the browser, there are no data transfers to external servers, ensuring robust data privacy and alleviating any concerns you may have.</p><p>You can experience it in action on our <a href="https://img.ly/showcases/cesdk/web/background-removal/web">background removal showcase</a>.</p><h4>Seamless Integration with IMG.LY’s CE.SDK</h4><p>IMG.LY’s Background Removal seamlessly integrates with IMG.LY’s CE.SDK, making it easier than ever to incorporate powerful in-browser image matting and background removal capabilities into your projects. Boost your creative endeavors with this intuitive integration.</p><p>The Neural Network (ONNX model) and WebAssembly (WASM) files used by IMG.LY’s Background Removal are hosted on UNPKG, making them readily available for download to all users of the library. However, if you prefer to host the data on your own servers, our library also supports custom asset serving. The choice is yours!</p><p>Background removal is often the first step in any creative workflow involving image composition. Whether you are developing e-commerce applications that need real-time background removal, enhancing user experience in image editing applications, or simplifying the creative process with web-based graphic design tools, IMG.LY’s Background Removal is your go-to solution.</p><h4>Empower Yourself with IMG.LY’s Background Removal</h4><p>Whether you are a professional developer or a hobbyist, this open source JavaScript library empowers you to deliver impressive applications and services with ease. Join the growing community of developers who are revolutionizing the way background removal is done.</p><p>Get started with @imgly/background-removal today by visiting <a href="https://socket.dev/npm/package/@imgly/background-removal">our official npm package page</a> and <a href="https://github.com/imgly/background-removal-js/">our GitHub repository</a>. You’ll find comprehensive documentation, examples, and everything you need to unlock the full potential of in-browser background removal.</p><p>Thank you for your support, and we can’t wait to see the incredible projects you’ll create with IMG.LY’s Background Removal. Stay tuned for more updates and enhancements as we continue to improve and expand this powerful library. Happy coding!</p><p><strong>Don’t forget to </strong><a href="https://photoeditorsdk.us13.list-manage.com/subscribe?u=dc9f652839dbb620d14d6d28d&amp;id=04a306e4b2"><strong>subscribe</strong></a><strong> to our newsletter to stay in the loop with the latest news and updates.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b19d57358d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/img-ly-announces-open-source-javascript-library-for-in-browser-background-removal-9b19d57358d5">IMG.LY Announces Open Source JavaScript Library for In-Browser Background Removal</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creative Workflows — the Future of Digital Asset Management]]></title>
            <link>https://medium.com/imgly/creative-workflows-the-future-of-digital-asset-management-bed2fa8cbb20?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/bed2fa8cbb20</guid>
            <category><![CDATA[white-label]]></category>
            <category><![CDATA[personalization]]></category>
            <category><![CDATA[sdk]]></category>
            <category><![CDATA[digital-asset-management]]></category>
            <category><![CDATA[content-creation]]></category>
            <dc:creator><![CDATA[Nes Dogan]]></dc:creator>
            <pubDate>Tue, 11 Apr 2023 20:09:41 GMT</pubDate>
            <atom:updated>2023-04-11T20:09:41.533Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creative Workflows — the Future of Digital Asset Management</h3><h4>The proliferation of marketing channels, shrinking customer segments, and personalized messaging increase the volume and variations of creatives and require ever-shorter iteration cycles. DAMs must evolve by incorporating creative workflows into their solution.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HlbIjiPPNYgo97sWu070HQ.png" /><figcaption>This article was originally <a href="https://img.ly/blog/creative-workflow-the-future-of-dam/">published</a> on 14 Feb 2023 by <a href="https://img.ly/blog/author/jan/">Jan Bussieck</a>.</figcaption></figure><p>Traditionally creative assets used to follow a clear lifecycle of conception, creation and use.</p><p>Designers and marketers have been thinking in terms of campaigns, timelines spanned months and the types of media to produce content for could be counted on one hand.</p><p>In this paradigm, digital asset management filled an important yet clearly circumscribed role; storing, sharing, and managing assets during the use phase of this lifecycle.</p><p>However, the rapid proliferation of digital publishing channels as well as the fast-moving nature of modern marketing campaigns means that the creation and adaptation of assets by stakeholders other than designers are becoming prevalent requirements across organizations. In the process, creative assets are increasingly becoming ‘living’ artifacts subject to frequent iterations involving many stakeholders.</p><h3>Growing Market Need for Integrated Creative Workflows</h3><p><a href="https://business.adobe.com/resources/digital-trends-report.html">Adobe’s most recent report on digital trends </a>shows the full extent of this shift, according to the report 79% of survey respondents identified as leaders of their industries agreed with the statement that customer expectations are constantly resetting to match their best omni-channel experience, 85% concurred that the demand for content has significantly increased.<br>The report goes on to underline that creative workflow challenges continue to pose the greatest challenge affecting organizations’ ability to keep up with and adequately serve customers’ needs.</p><h4>Common Challenges</h4><p>About half of the respondents consider <strong>workflow issues</strong> to be a critical internal barrier holding back their marketing organization.</p><p>Paul Nicholson, Senior Vice President of Production and Technology at Showtime Networks, states that his marketing team can be working on 600 to 800 pieces of promotional content at any given time, optimizing the workflow between design and marketing involving decision makers in a seamless and timely fashion and giving enough autonomy to non-designers make design changes themselves.</p><p>Success now requires hundreds of variations of images and videos for different ad networks, social networks, market segments and localizations. Every one of these variations in turn requires versions for creative optimizations and testing.</p><h3>The Need for Change</h3><p>This increased need for agility, shorter iteration cycles, and timelines means that content creation and distribution are becoming intertwined requiring a unified creative workflow.</p><p>In tandem with an increasing amount of publishing channels, the addressable customer segments within those channels are becoming smaller.</p><p>Digital advertising platforms are offering ever more granular targeting options on the basis of both demographic and behavioral data.</p><p>In order to take advantage of these focused targeting abilities, the creative content served to audiences needs to be customized accordingly.</p><p>For reference, the D2C pet food retailer Pets Deli saw its online conversion rates<a href="https://www.contentful.com/blog/ninetailed-pets-deli-personalization/"> increase by 51%</a> as soon as its marketing started tailoring materials to smaller segments as well as personalizing messaging.</p><h3>Threats and Opportunities for the DAM Industry</h3><p>These trends present the DAM space with great opportunities as well as threats from adjacent industries.</p><h4>The Opportunity</h4><p>As a result of the above mention market pressures, marketing teams need to scale up content creation with the use of tools that are specifically designed to iterate sets of related creatives using data and templates.<br>The natural evolution of a digital asset management system is then to become a 360 content hub empowering the marketing team and other stakeholders while freeing up the design team for more valuable work. A great example of a DAM company doing that is Bynder, <a href="https://www.bynder.com/en/products/studio/">its Studio solution</a> supports both images and videos and allows designers to create templates and define constraints so they are easily adaptable by marketers and other stakeholders.</p><h4>The Threat</h4><p>Just as DAMs need to expand their value proposition towards becoming tools for creating and managing change rather than static assets, design tools might expand to encompass traditional DAM functionality. <br>As these two domains merge both types of businesses will have to make a play for becoming the 360 content solution that meets the growing market demand described above. As such DAM companies will face competitive pressures from design-centered products.</p><p>Adobe’s <a href="https://business.adobe.com/products/experience-manager/assets/aem-assets.html">Cloud Experience DAM</a> for instance seamlessly fits with other Creative Cloud products such as Illustrator. The obvious advantage is that designers are already working with the tools and won’t have to make the shift to a different way of working.</p><p>The obstacle these companies face, however, is a classic<a href="https://en.wikipedia.org/wiki/The_Innovator%27s_Dilemma"> Innovators Dilemma</a>; it’s hard to add innovative, disruptive features to a mature product with a large customer base that might be unlikely to value those changes. It is easier for DAMs to secure early adopters for a new product line than for a design tool to move its established user base to use novel and substantially different features.</p><h3>Implementing a Creative Workflow with IMG.LY’s CE.SDK</h3><p>Technical viability poses the biggest challenge for implementing a creative workflow, apart from a great UX the complexities of building graphics processing on the web or mobile are immense.</p><p>Fortunately, you do not have to commit valuable engineering resources, time, and money to add creative editing to your <a href="https://img.ly/industries/digital-asset-management">DAM solution</a>. <br><a href="https://img.ly/creative-sdk">IMG.LY’s CreativeEditor SDK</a> is a cross-platform design editing and automation solution you can integrate with ease into any web, mobile, or desktop app and customize to fit your use case perfectly.</p><h4>Creative Workflow for DAMs Example</h4><p>Let’s look at an example workflow of an imaginary DAM Carpeta.</p><p>Carpeta’s customer OGNX is a skincare brand part of a large consumer brand conglomerate. Until now they have used Carpeta to distribute product designs and marketing material to the marketing and communications team, there are a host of files in different formats originating in various design tools.<br>OGNX is planning a large campaign for their new product line, but marketers are worried that design resources will present a bottleneck as they are planning to test different variations of CTA and color schemes in a large number of formats for different channels.</p><p>Luckily, Carpeta has just rolled out its new Creative Studio powered by CE.SDK.</p><p>OGNX’s design team can now import files from tools such as InDesign and start creating templates for marketers and A/B testers to work with.</p><h4>Creating Smart Templates</h4><p>In the example below, a designer is creating a template setting a constraint that the logo cannot be changed or rearranged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aaEtiV-EXRuBw_Y_1K2n8g.png" /><figcaption>Create Smart Templates with CE.SDK: Convert Elements to Placeholders for Customization Control.</figcaption></figure><h4>Defining Dynamic Elements Using Variables</h4><p>The text used as CTA is defined as a <strong>text variable</strong> to allow populating the template programmatically for each customer segment or personalized campaigns. Thereby ensuring that all designs are consistent with regard to branding while users adopting it have enough leeway to create unique variations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3KpmNgLlfxmt4nnxryeVjA.png" /><figcaption>Create Consistent Designs and Personalize Campaigns with Ease.</figcaption></figure><h4>Template delivery and adaptation</h4><p>Now, the template can be centrally stored in Carpeta’s DAM, and a marketing team preparing a campaign on social media can make changes to it using the CE.SDK design UI. In our example, they are testing different color schemes and CTAs which they provide from a central data store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PuhD5Ww8TRyAZ55idZyq3w.png" /><figcaption>Effortless Template Delivery and Adaptation: Edit and Customize with CE.SDK Design UI and Central Data Store.</figcaption></figure><h4>Automatically generating variation using the CE.SDK API</h4><p>In addition, Carpeta uses the <a href="https://img.ly/docs/cesdk/engine/">CE.SDK’s headless API</a> to generate designs in different user-defined formats for each social media channel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*Mjr7qBmUfHPSm9rz-_vChQ.jpeg" /><figcaption>Generate Design Variations with CE.SDK API: Create Custom Formats for Social Media Channels Automatically.</figcaption></figure><h3>Conclusion</h3><p>The way organizations work with their assets is evolving quickly, the proliferation of marketing channels, shrinking customer segments, and personalized messaging increase the volume and variations of creatives and require ever-shorter timelines and iteration cycles.<br>This presents a unique opportunity for <a href="https://img.ly/industries/digital-asset-management">digital asset management systems</a> to incorporate creative workflows into their solution and grow to become 360 content management and creation hubs meeting this demand.<br>IMG.LY’s CE.SDK allows DAM companies to focus entirely on delivering the optimal solution to their users while relying on battle-tested tech and category-leading UX to build optimal creative experiences.</p><p><a href="https://img.ly/forms/contact-sales"><strong>Schedule a demo today</strong></a><strong> to explore how you can integrate creative editing into your DAM product. Thank you for reading!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bed2fa8cbb20" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/creative-workflows-the-future-of-digital-asset-management-bed2fa8cbb20">Creative Workflows — the Future of Digital Asset Management</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing the Top 5 Open Source Image Manipulation Libraries for React Native]]></title>
            <link>https://medium.com/imgly/comparing-the-top-5-open-source-image-manipulation-libraries-for-react-native-33ddff4e058?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/33ddff4e058</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[comparison]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[photo-editing]]></category>
            <dc:creator><![CDATA[tuhinavonpbd]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 02:33:35 GMT</pubDate>
            <atom:updated>2022-09-16T02:33:34.936Z</atom:updated>
            <content:encoded><![CDATA[<p>This post was originally posted on 31st August.</p><p>Natalia Kuzminykh</p><p>While integrating visual content into your application, it is crucial to take into account image manipulations that can significantly enhance the quality of your product.</p><p>Thus, for example, reducing the background noise in combination with cropping the image or resizing can direct the user’s attention by eliminating distracting objects, while efficient caching of large images can speed up the page load. In fact, the variety of manipulation techniques is limited only by your needs and skills. In this guide, we are discussing five of the best image processing libraries that could be easily employed in your Reactive Native application. The image editing libraries are ranked according to their complexity, so even if you are new to the framework, you can always find something useful.</p><h4><a href="https://openbase.com/js/react-native-photo-editor"><strong>Native Photo Editor</strong></a></h4><p>Let’s start with one of the most comprehensive RN packages, which combines multiple features at once and provides access to a variety of fundamental techniques. By employing the Native Photo Editor API, one can immediately modify the image within the native UI through <em>Text</em> or <em>Stickers Integration, Animation, Cropping</em> or <em>Color,</em> and <em>Object Manipulation</em>. Regarding prerequisites, this library needs to be installed on React Native version 61 or higher, whereas for iOS-based applications, make sure you have CocoaPods dependencies enabled.</p><p>Overall, the Native Photo Editor can meet your needs and be handy in cases where you are required to edit photos in the application’s sandbox.</p><h4><strong>Example</strong></h4><p>First, run the following command in order to install the library.</p><pre>$ npm i react-native-photo-editor</pre><p>Afterwards, the integration of its API slightly differs for iOS and Android platforms: for <strong>iOS,</strong> you will need to update your Podfile by adding ios/Podfile to the script and run:</p><pre>use_native_modules!</pre><pre>pod &#39;RNPhotoEditor&#39;, :path =&gt; &#39;../node_modules/react-native-photo-editor/ios&#39;<br>use_frameworks! :linkage =&gt; :static<br>pod &#39;iOSPhotoEditor&#39;, :git =&gt; &#39;&lt;https://github.com/prscX/photo-editor&gt;&#39;, :branch =&gt; &#39;master&#39;</pre><pre>post_install do |installer|<br>installer.pods_project.targets.each do |target|<br>if target.name.include?(&#39;iOSPhotoEditor&#39;)<br>target.build_configurations.each do |config|<br>config.build_settings[&#39;SWIFT_VERSION&#39;] = &#39;5&#39;<br>end<br>end<br>end<br>end</pre><h3>Follow Flipper iOS Setup Guidelines</h3><h3>This is required because iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile</h3><pre>$static_framework = [&#39;FlipperKit&#39;, &#39;Flipper&#39;, &#39;Flipper-Folly&#39;,<br>&#39;CocoaAsyncSocket&#39;, &#39;ComponentKit&#39;, &#39;Flipper-DoubleConversion&#39;,<br>&#39;Flipper-Glog&#39;, &#39;Flipper-PeerTalk&#39;, &#39;Flipper-RSocket&#39;, &#39;Yoga&#39;, &#39;YogaKit&#39;,<br>&#39;CocoaLibEvent&#39;, &#39;OpenSSL-Universal&#39;, &#39;boost-for-react-native&#39;]</pre><pre>pre_install do |installer|<br>Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}<br>installer.pod_targets.each do |pod|<br>if $static_framework.include?(pod.name)<br>def pod.build_type;<br>Pod::BuildType.static_library<br>end<br>end<br>end<br>end</pre><pre>Whereas for <strong>Android,</strong> make sure to add the following to your <strong>build.gradle:</strong></pre><pre>buildscript {<br>repositories {<br>maven { url &quot;&lt;https://jitpack.io&gt;&quot; }<br>...<br>}<br>}<br>allprojects {<br>repositories {<br>maven { url &quot;&lt;https://jitpack.io&gt;&quot; }<br>...<br>}<br>}</pre><pre>Then, you can integrate this piece into your code in order to start playing with the library:</pre><pre>import PhotoEditor from &#39;react-native-photo-editor&#39;</pre><pre>PhotoEditor.Edit({<br>path: RNFS.DocumentDirectoryPath + &quot;/photo.jpg&quot;<br>});</pre><pre><a href="https://openbase.com/js/react-native-photo-manipulator"><strong>Photo Manipulator</strong></a></pre><pre>We are now moving to a more sophisticated image processing package, which opens up the possibility of programmatically modifying your visual asset. The Photo Manipulator package can be employed for projects built on React Native starting from version 60. Among the features it provides are <em>Cropping</em> and <em>Resizing</em>, <em>Quality Optimization, Image Overlay, Text Integration</em> and <em>Batching</em> of all features simultaneously.</pre><pre>This library can save you time when integrating image manipulation into your application due to its easy usage and powerful batch application of all features. The typical use case could be a photo editor like Instagram.</pre><pre>Example</pre><pre>Start your exciting adventure with Photo Manipulator by running in your terminal:</pre><pre>$ npm i react-native-photo-manipulator</pre><pre>Then, you can directly import its API to your code:</pre><pre>import RNPhotoManipulator from &#39;react-native-photo-manipulator&#39;;</pre><pre>const image = &quot;&lt;https://unsplash.com/photos/qw6qQQyYQpo/download?force=true&gt;&quot;;</pre><pre>// Crop and resize the image to 200 x 150:<br>const cropRegion = { x: 5, y: 30, height: 400, width: 250 };<br>const targetSize = { height: 200, width: 150 };</pre><pre>RNPhotoManipulator.crop(image, cropRegion, targetSize).then(path =&gt; {<br>console.log(Result image path: ${path});<br>});</pre><pre>// Optimize your image by enhancing its quality to 90, and save the result in jpeg format:<br>const quality = 90;</pre><pre>RNPhotoManipulator.optimize(image, 90).then(path =&gt; {<br>console.log(Result image path: ${path});<br>});</pre><pre>// Overlay image on top of background image:<br>const overlay = &quot;&lt;https://www.iconfinder.com/icons/1174949/download/png/128&gt;&quot;;<br>const position = { x: 5, y: 20 };</pre><pre>RNPhotoManipulator.overlayImage(image, overlay, position).then(path =&gt; {<br>console.log(Result image path: ${path});<br>});</pre><pre>// Add text to your image:<br>const texts = [<br>{ position: { x: 50, y: 30 }, text: &quot;Text 1&quot;, textSize: 30, color: &quot;#000000&quot; },<br>{ position: { x: 50, y: 30 }, text: &quot;Text 1&quot;, textSize: 30, color: &quot;#FFFFFF&quot;, thickness: 3 }<br>];</pre><pre>RNPhotoManipulator.printText(image, texts).then(path =&gt; {<br>console.log(Result image path: ${path});<br>});</pre><pre>// Crop, resize and do operations (overlay and printText) on image:<br>const cropRegion = { x: 5, y: 30, height: 400, width: 250 };<br>const targetSize = { height: 200, width: 150 };<br>const operations = [<br>{ operation: &quot;text&quot;, options: { position: { x: 50, y: 30 }, text: &quot;Text 1&quot;, textSize: 30, color: &quot;#000000&quot; } },<br>{ operation: &quot;overlay&quot;, overlay: &quot;&lt;https://www.iconfinder.com/icons/1174949/download/png/128&gt;&quot;, position: { x: 5, y: 20 } },<br>];<br>const quality = 90;</pre><pre>RNPhotoManipulator.batch(image, cropRegion, targetSize, operations, quality).then(path =&gt; {<br>console.log(Result image path: ${path});<br>});</pre><pre><a href="https://openbase.com/js/react-native-image-crop-picker"><strong>Image Crop Picker</strong></a></pre><pre>Image Crop Picker is another example of a powerful open-source library for iOS and Android applications. It’s designed specifically for modifying the <em>camera</em>-based static assets and dynamic <em>videos</em> through <em>cropping</em>, <em>compressing,</em> and <em>multiplication</em>. Thus, the advantage that distinguishes this package from similar ones is its ability to crop and compress images, which is extremely important when creating an image editing app, since large files can cause issues with performance.</pre><pre>Moreover, it’s recommended to use version 0.25 and higher for the React Native based on v.60 (and above); for older versions, you need to apply older versions of the Image Crop Picker library.</pre><pre>Example</pre><pre>Let’s begin with the installation of the library:</pre><pre>$ npm i react-native-image-crop-picker</pre><pre>Once the system is set up, you can import the Image Crop Picker API with the following:</pre><pre>import ImagePicker from &#39;react-native-image-crop-picker&#39;;</pre><pre>// Crop a single image to a size 300 x 400:<br>ImagePicker.openPicker({<br>width: 300, height: 400, cropping: true<br>}).then(image =&gt; {console.log(image);<br>});</pre><pre>// Crop several images with one command:<br>ImagePicker.openPicker({<br>multiple: true<br>}).then(images =&gt; {console.log(images);<br>});</pre><pre>// Select image from camera and crop it to a size 300 x 400:<br>ImagePicker.openCamera({<br>width: 300, height: 400, cropping: true,<br>}).then(image =&gt; {console.log(image);<br>});</pre><pre>//This library also supports manipulations with video; check the documentation for more details.</pre><pre><a href="https://openbase.com/js/react-native-image-filter-kit"><strong>Image Filter Kit</strong></a></pre><pre>The following library could be an ideal manipulation tool for a photo editing application. Image Filter Kit library differs significantly from previous packages by the number of filters it supports. Thus, an asset can be modified in terms of its <em>color/convolve matrix</em> or <em>composition</em>, whereas the distracting objects could be <em>blended, blurred,</em> or <em>extracted</em>. Moreover, Android-only or iOS-only filters could also be implemented depending on the system you are working with.</pre><pre>The Image Filter Kit can be employed for the Reactive Native systems of version 64 and higher (note that in this case, it also limits Android to min v.21 and iOS min v.9). For the projects based on the RN from 57.1 (and up to v.64), the min Android version should be set to 17 and for iOS to v.9.</pre><pre>Example</pre><pre>Start by once again installing the API of this library to your device:</pre><pre>$ npm i react-native-image-filter-kit</pre><pre>The set of features supported by the library is vast, so here we give just a brief example from which you could start working with Image Filter Kit:</pre><pre>// Import the library<br>import {<br>SoftLightBlend, // Blend filter<br>Emboss, // Convolve matrix filter<br>Earlybird, // CSSGram filter<br>Invert,<br>RadialGradient} from &#39;react-native-image-filter-kit&#39;</pre><pre>const result = (<br>&lt;Earlybird<br>image={<br>&lt;SoftLightBlend<br>resizeCanvasTo={&#39;dstImage&#39;}<br>dstTransform={{ scale: &#39;CONTAIN&#39; }}<br>dstImage={<br>&lt;Emboss    // Emboss an image to create a realistic outline effect<br>image={<br>&lt;Image<br>style={{ width: 320, height: 320 }}<br>source={require(&#39;./parrot.png&#39;)}<br>resizeMode={&#39;contain&#39;}<br>/&gt;<br>}<br>/&gt;<br>}<br>srcTransform={{<br>anchor: { x: 0.5, y: 1 }, translate: { x: 0.5, y: 1 }<br>}}<br>srcImage={<br>&lt;Invert // Invert and Adjust Radial Gradient of the image to red<br>image={<br>&lt;RadialGradient<br>colors={[&#39;rgba(0, 0, 255, 1)&#39;, &#39;#00ff00&#39;, &#39;red&#39;]}<br>stops={[0.25, 0.75, 1]}<br>center={{ x: &#39;50w&#39;, y: &#39;100h&#39; }}<br>/&gt;<br>}<br>/&gt;<br>}<br>/&gt;<br>}<br>/&gt;<br>)</pre><pre><a href="https://github.com/DylanVann/react-native-fast-image"><strong>FastImage</strong></a></pre><pre>Once you have finished modifying images, you could think about their final presentation on your users&#39; devices and the memory problems that can occur when large resources are incorrectly cached. The FastImage library is designed to handle such challenges and correctly process <em>image caching</em> information in order to avoid flickering, cache misses and low performance. Among other things the package is capable of are the support of <em>GIF assets, Border radius, Preload images,</em> and <em>Headers Authorization</em>. The only disadvantage of this package is the low support for the older versions of React Native (such as below v.60).</pre><pre>Example</pre><pre>To install the library:</pre><pre>$ npm i react-native-fast-image</pre><pre>Then, we are going to import the library and set up some main settings:</pre><pre>import FastImage from &#39;react-native-fast-image&#39;</pre><pre>const YourImage = () =&gt; (<br>&lt;FastImage<br>style={{ width: 200, height: 200 }}<br>source={{<br>uri: &#39;&lt;https://unsplash.it/400/400?image=1&gt;&#39;,<br>headers: { Authorization: &#39;someAuthToken&#39; }, // Add authorization headers;<br>priority: FastImage.priority.normal, // Adjust the priority of images;<br>}}<br>resizeMode={FastImage.resizeMode.contain}<br>/&gt;<br>)</pre><pre><a href="https://shopify.github.io/react-native-skia/"><strong>React Native Skia</strong></a></pre><pre>In the end, we have a bonus library with extremely powerful 2D graphic capabilities. <strong><em>React Native Skia</em></strong> originates from the open-source Skia Graphics Library, which powers the graphics engine of Google Chrome, Chrome OS, Firefox OS Android, Flutter and many other platforms. Thus, by deploying this package into your RN product, you can benefit from fantastic drawings or even UI effects like <em>Neumorphism</em> and <em>Glassmorphism</em>.</pre><pre>Example</pre><pre>Don’t forget to install the library dependencies:</pre><pre>npm install @shopify/react-native-skia</pre><pre>//Alternatively, you can opt for running the library in your web browser with the expo (See here for more details):<br>//expo install @shopify/react-native-skia // Don&#39;t forget to uncomment this line</pre><pre>Once everything is set up, you can turn on the Skia engine with the following declarative API:</pre><pre>import {Canvas, Circle, Group} from &quot;@shopify/react-native-skia&quot;;<br> <br>export const HelloWorld = () =&gt; {<br>const size = 256;<br>const r = size * 0.33;<br>return (<br>&lt;Canvas style={{ flex: 1 }}&gt;<br>&lt;Group blendMode=&quot;multiply&quot;&gt;<br>&lt;Circle cx={r} cy={r} r={r} color=&quot;cyan&quot; /&gt;<br>&lt;Circle cx={size - r} cy={r} r={r} color=&quot;magenta&quot; /&gt;<br>&lt;Circle<br>cx={size/2}<br>cy={size - r}<br>r={r}<br>color=&quot;yellow&quot;<br>/&gt;<br>&lt;/Group&gt;<br>&lt;/Canvas&gt;<br>);<br>};</pre><pre><strong>CONCLUSION</strong></pre><pre>Thus, the best React Native image processing libraries vary in terms of their functionality, from simple ones providing limited image manipulation capabilities to more advanced libraries capable of modifying the image and how it works in your user interface system.</pre><pre>If you are looking for a production-grade photo editor with all the above features and a customizable professional UI have a look at our <a href="https://img.ly/photo-sdk?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos"><strong>PhotoEditor SDK</strong></a>. If you want to go beyond simple image editing and your project requires support for templates, creative automation, or more complex designs, you should check out the <a href="https://img.ly/creative-sdk?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos"><strong><em>CreativeEditor SDK</em></strong></a>.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33ddff4e058" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/comparing-the-top-5-open-source-image-manipulation-libraries-for-react-native-33ddff4e058">Comparing the Top 5 Open Source Image Manipulation Libraries for React Native</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time-Based Sprites for VE.SDK on iOS and Android]]></title>
            <link>https://medium.com/imgly/time-based-sprites-for-ve-sdk-on-ios-and-android-c308a16d4697?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/c308a16d4697</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[release-notes]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[tuhinavonpbd]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 02:28:25 GMT</pubDate>
            <atom:updated>2023-04-11T19:44:38.016Z</atom:updated>
            <content:encoded><![CDATA[<p>We are happy to extend our video editing with a highly-requested feature: <strong>Time-Based Sprites</strong>. This new feature sets the <strong>duration of text </strong>and <strong>stickers </strong>in your video timeline. Users may now place fun stickers and text at the right moment, and give their videos a special touch.</p><h4>Time-Based Sprites</h4><p>The popular feature known from TikTok and Instagram Reels is now available in VE.SDK: set the starting and end point of your text or sticker. Tap your text or sticker and select <em>Duration</em> to determine the duration of your asset.</p><p>Unless you have specified a custom set of sticker or text actions, this feature is <strong>enabled by default</strong> since VE.SDK v10.3.0 for Android and v11.3.0 for iOS. See the official <a href="https://img.ly/docs/vesdk/ios/guides/trim/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">documentation for iOS</a> or <a href="https://img.ly/docs/vesdk/android/guides/trim/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes#trim-sprite-duration">Android</a> on Time-Based Sprites.</p><h4>Why is Video Important?</h4><p>Video content has become an essential medium for social media, marketing, sales, and support teams. According to marketing <a href="https://www.wyzowl.com/video-marketing-statistics/">statistics</a>, people are watching an average of <strong>19 hours</strong> of online video per week in 2022. <strong>88%</strong> of people say that they felt convinced to buy a product or service by watching a brand’s video. The growing trend and preference of consumers are why businesses are shifting their attention toward including videos in their strategies and applications.</p><p>We commit to extending our video editing features to help developers meet the demand, save resources and streamline the process of building great applications. Let us have a look at our <strong>previous VE.SDK releases</strong>:</p><p><strong>Video Composition</strong><br>Users may seamlessly edit their footage by trimming and adjusting video files with advanced filters. Finally, they can set the correct order of their video sequences to create a single composition.</p><p><strong>Audio Support</strong><br>Replace or add sound in videos by loading audio files. Users can trim their audio according to their footage. Developers can provide media libraries for audio and video files. That way, users may access media by choosing from labeled folders, such as genre, theme, or artist names.</p><p><strong>Force Trim</strong><br>The VE.SDK trim tool allows users to determine the start and end frame of a video clip and change the duration of their footage. Now you can enforce a <strong>minimum and maximum length </strong>of videos. Force Trim will come in handy for use cases, such as social media stories and posts popularly limited to bite size 15 or 60 seconds by widely loved apps — see TikTok or Instagram. Adopting a ready-to-use solution like <a href="https://img.ly/video-sdk/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">VE.SDK</a> will set you on your path to creating equally beautiful apps.</p><p>Thanks for reading! Let us know what you think on <a href="https://twitter.com/imgly">Twitter</a> — or check out our <a href="https://photoeditorsdk.us13.list-manage.com/subscribe?u=dc9f652839dbb620d14d6d28d&amp;id=04a306e4b2">Newsletter</a> for more accelerating updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c308a16d4697" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/time-based-sprites-for-ve-sdk-on-ios-and-android-c308a16d4697">Time-Based Sprites for VE.SDK on iOS and Android</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Crop and Trim Videos In Kotlin for Android]]></title>
            <link>https://medium.com/imgly/how-to-crop-and-trim-videos-in-kotlin-for-android-a1438e10ce76?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/a1438e10ce76</guid>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[video-editing]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[tuhinavonpbd]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 02:19:42 GMT</pubDate>
            <atom:updated>2022-09-16T02:19:42.273Z</atom:updated>
            <content:encoded><![CDATA[<p>This post was originally posted on 2nd Septemeber 2022.</p><p>Paul Knulst</p><p>Cropping and trimming videos is a notoriously difficult task to achieve on Android. One way to implement this functionality is by using FFmpeg a free open-source suite of tools that can perform a wide range of tasks, from video converting to editing. Normally FFmpeg is used from the command line, to use it correctly in Android you have to understand its underlying APIs and how to use them.</p><p>In this tutorial, you will learn how to crop and trim videos in Android by using FFmpeg. Even if you are a beginner you should be able to follow the steps to achieve the desired results.</p><p>I try to summarise the most important basics that you need to know to manipulate videos with FFmpeg. After reading this article you should be able to use it in your own applications. Furthermore, I have developed a sample application and library that can be used to trim and crop videos with an Android device.</p><h4>What is FFmpeg</h4><p>FFmpeg is a great multimedia framework that is able to <strong>mux</strong>, <strong>demux</strong>, <strong>decode</strong>, <strong>encode</strong>, <strong>transcode</strong>, <strong>filter</strong>, **stream, **and **play **most media content that exists. FFmpeg supports different tools that can be used to develop an application to manipulate any kind of media to the desired output. You do not have any limitations on what to do with multimedia when using FFmpeg.</p><p>Unfortunately, to use FFmpeg in an Android App using Kotlin you have to compile and build the libraries to use them as a dependency in your project. This process is not straightforward because you have to manually compile a C/C++ library with help of the Android NDK.</p><p>Luckily, many people already have done this and we are able to use their compiled library in our project. However, if you want to compile FFmpeg from scratch you can do this. All necessary information should be available within the <a href="https://developer.android.com/studio/projects/add-native-code">android developer documentation</a>.</p><p>To show you how we can use FFmpeg in our app I will use a compiled FFmpeg library that can be found here: <a href="https://github.com/WritingMinds/ffmpeg-android-java">https://github.com/WritingMinds/ffmpeg-android-java</a>. To find other FFmpeg libraries you can have a look at the <a href="https://trac.ffmpeg.org/wiki/CompilationGuide/Android">official FFmpeg wiki</a> where several pre-packaged sources are listed.</p><h4>Setting up the project</h4><p>In order to use the FFmpeg library of WritingMinds (or any other library), we have to follow some simple steps.</p><h4>1. Add dependency for the FFmpeg library to your app-level build.gradle</h4><pre>dependencies {<br>implementation fileTree(dir: &#39;libs&#39;, include: [&#39;*.jar&#39;])<br>implementation &#39;com.writingminds:FFmpegAndroid:0.3.2&#39;<br>}</pre><h4>2. Check if your device supports the current implementation of FFmpeg or not</h4><pre>fun initialize() {<br>val ffmpeg = FFmpeg.getInstance(ctx.applicationContext)<br>try {<br>ffmpeg.loadBinary(object : LoadBinaryResponseHandler() {<br>override fun onFinish() {<br>super.onFinish()<br>}</pre><pre>override fun onSuccess() {<br>                super.onSuccess()<br>            }<br><br>            override fun onFailure() {<br>                super.onFailure()<br>            }<br><br>            override fun onStart() {<br>                super.onStart()<br>            }<br>        })<br>    } catch (e: FFmpegNotSupportedException) {<br>        Log.e(&quot;FFmpeg&quot;, &quot;Your device does not support FFmpeg&quot;)<br>    }<br>}</pre><h4>3. Initialize the FFmpeg module (leave command blank)</h4><pre>val ffmpeg = FFmpeg.getInstance(ctx)<br>ffmpeg.loadBinary(object : FFmpegLoadBinaryResponseHandler {<br>override fun onFinish() {<br>Log.d(&quot;FFmpeg&quot;, &quot;onFinish&quot;)<br>}</pre><pre>override fun onSuccess() {<br>            Log.d(&quot;FFmpeg&quot;, &quot;onSuccess&quot;)<br>            val command = //TODO: the command will added here later<br>            try {<br>                ffmpeg.execute(command, object : ExecuteBinaryResponseHandler() {<br>                    override fun onSuccess(message: String?) {<br>                        super.onSuccess(message)<br>                        Log.d(TAG, &quot;onSuccess: &quot; + message!!)<br>                    }<br><br>                    override fun onProgress(message: String?) {<br>                        super.onProgress(message)<br>                        Log.d(TAG, &quot;onProgress: &quot; + message!!)<br>                    }<br><br>                    override fun onFailure(message: String?) {<br>                        super.onFailure(message)<br>                        Log.e(TAG, &quot;onFailure: &quot; + message!!)<br>                    }<br><br>                    override fun onStart() {<br>                        super.onStart()<br>                        Log.d(TAG, &quot;onStart&quot;)<br>                    }<br><br>                    override fun onFinish() {<br>                        super.onFinish()<br>                        Log.d(TAG, &quot;onFinish&quot;)<br>                    }<br>                })<br>            } catch (e: FFmpegCommandAlreadyRunningException) {<br>                        Log.e(&quot;FFmpeg&quot;, &quot;FFmpeg runs already&quot;)<br>            }<br>        }<br><br>        override fun onFailure() {<br>            Log.e(&quot;FFmpeg&quot;, &quot;onFailure&quot;)<br>        }<br><br>        override fun onStart() {<br>        }<br>    })</pre><h4>4. Implement the commands you want to use in your app</h4><pre>All commands that are supported by FFmpeg can be included in your app with help of an array. This is done by passing every command line argument as a single element within the array. The array will then be translated into an FFmpeg command using the execute method from FFmpeg:</pre><pre>ffmpeg.execute(command, object : ExecuteBinaryResponseHandler() { ... }</pre><pre>As we want to implement Trim and Crop I will show how this can be done using the arrayOf function.</pre><pre><strong>Trim:</strong></pre><pre>val command = arrayOf(&quot;-y&quot;, &quot;-i&quot;, input, &quot;-ss&quot;, startPos, &quot;-to&quot;, endPos, &quot;-c&quot;, &quot;copy&quot;, output)</pre><ul><li><strong>“-y”:</strong> overwrites output files without asking</li><li><strong>“-i”:</strong> specifies an input file</li><li><strong>input:</strong> the path of the source video to trim</li><li><strong>“-ss”:</strong> specifies that the next value will be the starting point of the resulting video</li><li><strong>startPos:</strong> the starting position in “%d:%02d:%02d” format</li><li><strong>“-to”:</strong> specifies that the next value will be the end position of the resulting video</li><li><strong>endPos:</strong> the end position in “%d:%02d:%02d” format</li><li><strong>“-c” AND “copy”</strong>: defines that the stream will not be encoded. The resulting video will only be saved.</li><li><strong>output:</strong> the path of the resulting video</li></ul><pre>To better understand every argument you can have a look at <a href="https://www.ffmpeg.org/ffmpeg.html#Main-options">the official FFmpeg documentation</a>.</pre><pre>Additionally, to provide arguments for startPos and endPos you normally would have to use a utility function that converts the timestamp of the start and end position into the desired &quot;%d:%02d:%02d&quot; format (a string):</pre><pre>fun convertTimestampToString(timeInMs: Float): String {<br>val totalSeconds = (timeInMs / 1000).toInt()<br>val seconds = totalSeconds % 60<br>val minutes = totalSeconds / 60 % 60<br>val hours = totalSeconds / 3600<br>val formatter = Formatter()<br>return if (hours &gt; 0) {<br>formatter.format(&quot;%d:%02d:%02d&quot;, hours, minutes, seconds).toString()<br>} else {<br>formatter.format(&quot;%02d:%02d&quot;, minutes, seconds).toString()<br>}<br>}</pre><pre><strong>Crop:</strong></pre><pre>val command = arrayOf(&quot;-i&quot;, input, &quot;-filter:v&quot;, &quot;crop=$w:$h:$x:$y&quot;, &quot;-threads&quot;, &quot;5&quot;, &quot;-preset&quot;, &quot;ultrafast&quot;, &quot;-strict&quot;, &quot;-2&quot;, &quot;-c:a&quot;, &quot;copy&quot;, output)</pre><ul><li><strong>“-i”:</strong> specifies an input file</li><li><strong>input:</strong> the path of the source video to trim</li><li><strong>“-filter:v”:</strong> defines that a filtergraph is used</li><li><strong>“crop=$w:$h:$x:$y”:</strong> use crop functionality to crop a part from the video start at point x:y and having a width(w) and height(h).</li><li><strong>“-threads”:</strong> specifies that the next value will set the thread count</li><li><strong>“5”:</strong> the number of threads to use</li><li><strong>“-preset”:</strong> specifies that the next value will set the encoding preset</li><li><strong>“ultrafast”:</strong> the encoding preset to use</li><li><strong>“-strict”:</strong> specifies how strictly the standards should be followed</li><li><strong>“-2”:</strong> the strict value</li><li><strong>“-c:a” AND “copy”</strong> defines that the stream will not be encoded and ALL audio streams will also be used.</li><li><strong>output:</strong> the path of the resulting video</li></ul><pre>Also, check <a href="https://www.ffmpeg.org/ffmpeg.html#Main-options">the official FFmpeg documentation</a> to better understand every argument.</pre><pre>5. Implement the UI</pre><pre>To create a fancy UI you should create a custom view that shows some of the frames available in the video (VideoPreviewView). Also, it should contain a SeekBar for **cropping **and a RangeSeekBar for <strong>trimming</strong>. The SeekBar will be used to switch to a certain timestamp within the video to see what is actually trimmed or cropped. The RangeSeekBar will only be used within the trimming UI to define the start and end position of the resulting video.</pre><pre>While SeekBar is <a href="https://developer.android.com/reference/android/widget/SeekBar">an Android Widget</a> the RangeSeekBar is more complicated but there exist several implementations that can be used: By <a href="https://github.com/tizisdeepan/VideoEditor/blob/master/video-editor/src/main/java/com/video/trimmer/view/RangeSeekBarView.kt">Tiszideepan</a>, By <a href="https://github.com/HemendraGangwar/VideoTrimmingLikeWhatsapp/blob/master/app/src/main/java/com/hg/gangwar/videoTrimmer/view/RangeSeekBarView.java">HemendraGangwar</a>.</pre><pre>You can implement the VideoPreviewView with an easy approach. Divide the video into a specific number of frames that are based on the view&#39;s width and display every frame sequentially within a single view to have a preview. To do this you need the width of the view and the duration of the video that can be found using the <a href="https://developer.android.com/reference/android/media/MediaMetadataRetriever">MediaMetadataRetriever</a>. With the MediaMetadataRetriever, you can use getFrameAtTime() to fetch a single frame at a specific timestamp. If you now want to display a complete video preview you need to display viewWidth / frameWidth frames. Unfortunately, depending on the video length and video width, it could happen that only a few frames will be present within the VideoPreviewView. To fix this problem you have to maintain a threshold to ensure that a specific number of frames are displayed. This means that you have to crop the frames to a certain width until calculated frames equal the threshold.</pre><pre>The following code snippet will show how you can achieve this:</pre><pre>private fun createPreview(viewWidth: Int) {<br>BackgroundExecutor.execute(object : BackgroundExecutor.Task(&quot;&quot;, 0L, &quot;&quot;) {<br>override fun execute() {<br>try {<br>val threshold = 11<br>val thumbnails = LongSparseArray&lt;Bitmap&gt;()<br>val mediaMetadataRetriever = MediaMetadataRetriever()<br>mediaMetadataRetriever.setDataSource(context, videoUri)<br>val videoLengthInMs = (Integer.parseInt(<br>mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)<br>) * 1000).toLong()<br>val frameHeight = viewHeight<br>val initialBitmap = mediaMetadataRetriever.getFrameAtTime(<br>0,<br>MediaMetadataRetriever.OPTION_CLOSEST_SYNC<br>)<br>val frameWidth =<br>((initialBitmap.width.toFloat() / initialBitmap.height.toFloat()) * frameHeight.toFloat()).toInt()<br>var numThumbs = ceil((viewWidth.toFloat() / frameWidth)).toInt()<br>if (numThumbs &lt; threshold) {<br>numThumbs = threshold<br>}<br>val cropWidth = viewWidth / threshold<br>val interval = videoLengthInMs / numThumbs<br>for (i in 0 until numThumbs) {<br>var bitmap = mediaMetadataRetriever.getFrameAtTime(<br>i * interval,<br>MediaMetadataRetriever.OPTION_CLOSEST_SYNC<br>)<br>bitmap?.let {<br>try {<br>bitmap = Bitmap.createScaledBitmap(<br>bitmap,<br>frameWidth,<br>frameHeight,<br>false<br>)<br>bitmap = Bitmap.createBitmap(bitmap, 0, 0, cropWidth, bitmap.height)<br>} catch (e: Exception) {<br>Log.e(TAG, &quot;error while create bitmap: $e&quot;)<br>}<br>thumbnails.put(i.toLong(), bitmap)<br>}<br>}<br>mediaMetadataRetriever.release()<br>returnBitmaps(thumbnails)<br>} catch (e: Throwable) {<br>Thread.getDefaultUncaughtExceptionHandler()<br>.uncaughtException(Thread.currentThread(), e)<br>}<br>}<br>})<br>}</pre><pre>Additionally, for cropping a video you need to display a <em>crop rectangle</em> within the UI to let users decide which part of the video they want to crop. Also, you have to give users the ability to reposition the crop area. To do this, you can use <a href="https://github.com/ArthurHub/Android-Image-Cropper">the ImageCropper library from ArthurHub</a> which is initially designed to crop an image but can also be used for videos as you only need the values from the rectangle. Add the ImageCropper to your project:</pre><pre>dependencies {<br>implementation &#39;com.theartofdev.edmodo:android-image-cropper:2.8.0&#39;<br>}</pre><pre>Now, you can extend a CropperActivity which loads the current frame of the video (that you can extract with the VideoPreviewView) by inserting the CropImageView layout to get the cropping bounds. Once, you select an area in the UI, the rectangle values can be extracted and used to calculate the needed values for video cropping with this function:</pre><pre>val rect = cropFrame.cropRect<br>val w = abs(rect.left - rect.right)<br>val h = abs(rect.top - rect.bottom)<br>val x = rect.left<br>val y = rect.top</pre><pre>These values will then be used as input variables for the FFmpeg crop command.</pre><pre>To help you use all this information I created a project that uses all explained snippets to create a sample app that can crop and trim videos. The source code can be found <a href="https://github.com/paulknulst/VideoTrimmer">on my personal GitHub</a>.</pre><pre>Fixing error=13, Permission denied</pre><pre>Unfortunately, if you implement the described functionality and use the compiled FFmpeg library you will run into this problem if you compile your app for SDK 29 and onwards.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/0*VZfhqbxmCI4FL0xP.png" /><figcaption>Permission denied error due to wrong target SDK</figcaption></figure><pre>Permission denied error due to wrong target SDK The problem is caused because from Android Q onwards it is not allowed to execute binaries in your app&#39;s private data directory. The error is described in <a href="https://issuetracker.google.com/issues/128554619?pli=1">the official issue tracker from google</a>.</pre><pre>One solution will be that you compile your app for SDK 28 but this could lead to problems if you try to put your app into the Android Play Store.</pre><pre>Another solution will be that you compile your app for SDK 29 and stop putting binaries in any not supported directory. Unfortunately, the code that moves the binaries is within the 3rd party lib from WritingMinds and has to be removed by you (with a Pull Request) or by the maintainer of the library. A future-proof solution will be that you stop using external binaries and start compiling dependencies as an NDK project. This will be a lot of work but you can find help within a famous repository that compiles CPP to Java and also has FFmpeg: <a href="https://github.com/bytedeco/javacpp-presets/tree/master/ffmpeg">https://github.com/bytedeco/javacpp-presets/tree/master/ffmpeg</a></pre><pre>Add more commands</pre><pre>After you implemented crop and trim you maybe want to add more cool features to your Android app. To do this with FFmpeg and the previously described code you can do this by simply creating a new function within the VideoCommands() and translate the FFmpeg command into a VideoCommands() function.</pre><pre>The next sections will describe some fancy functions that would improve the usability of your app. Just add a new function with this command and fill the callbacks with a toast or anything else. Then call the function from anywhere within your app (because you do not need UI for this).</pre><pre>Removing audio from videos</pre><pre>You might run into a scenario where you’d only like to keep the visuals of a video and remove the audio track, for instance for voicing over certain footage or removing background noise:</pre><pre>val command = arrayOf(&quot;-i&quot;, input, &quot;-an&quot;, output)</pre><h4>Compress a video</h4><pre>Make big videos smaller to save your valuable disk resources.</pre><pre>val command = arrayOf(&quot;-i&quot;, input, &quot;-vf&quot;, &quot;scale=$w:$h&quot;, &quot;-c:v&quot;, &quot;libx264&quot;, &quot;-preset&quot;, &quot;veryslow&quot;, &quot;-crf&quot;, &quot;24&quot;, output)</pre><pre><strong>$w and $h</strong> are the new sizes (should be smaller). If one is -1 it will keep the ratio and is automatically adjusted in relation to the other one.</pre><pre>Change playback speed</pre><pre>Increase the playback speed to make long videos faster or decrease it for showing something really awesome very slowly.</pre><pre>val command = arrayOf(&quot;-i&quot;, input, &quot;-vf&quot;, &quot;\\&quot;setpts=$scale*PTS\\&quot;&quot;, output)</pre><pre><strong>$scale</strong> should be &gt; 1 for slowing down a video or &lt; 1 for fastening a video.</pre><pre>More</pre><pre>To find more cool commands search <a href="https://www.ffmpeg.org/ffmpeg.html">the official argument documentation</a> and implement them by putting every argument into a value of the array function as described earlier.</pre><pre>For production-grade application you may be better served by using our <a href="https://img.ly/video-sdk?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos">VideoEditorSDK</a> which in addition to professional trim and crop features allows your users to add filters, text and audio overlays. Recently, we released time-based sprites as well allowing users to time the appearance of text and stickers in videos.</pre><pre>Closing Notes</pre><pre>In this article, you learned that you can use FFmpeg to crop and trim videos on Android. Unfortunately, it does not work out of the box and you have to compile the library using complex techniques. Luckily, there exist some useful libraries that do the heavy lifting for you.</pre><pre><a href="https://github.com/paulknulst/VideoTrimmer">Using my app as a baseline</a> you are able to crop and trim videos. Additionally, you can implement more commands easily if they do not need a GUI because creating a fancy-looking GUI was a complicated part of developing a cropping and trimming app.</pre><pre>Unfortunately, there are problems with the library that was used because Android Q introduces a security fix that forbids apps to execute binaries within their data folder. But, this is only a problem if you want to create a &quot;Google Play Store&quot; ready app because you can avoid this problem if compile your app for SDK 28 (and lower). Keep in mind that if you want to create a private app that you distribute on your website instead of using the Play Store you can do this. But, if you want to upload your app to the Google Play Store you have to search for <a href="https://trac.ffmpeg.org/wiki/CompilationGuide/Android">another FFmpeg library within the documentation</a> or build one from scratch so you can compile your app for the current needed SDK.</pre><pre>I hope you enjoyed reading this article and are able to create an Android app that can crop and trim videos. If you have any questions, need help, or want to give feedback consider commenting in the comments section. I would am happy to help.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1438e10ce76" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/how-to-crop-and-trim-videos-in-kotlin-for-android-a1438e10ce76">How To Crop and Trim Videos In Kotlin for Android</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Simple Real-Time Video Editor with Metal for iOS]]></title>
            <link>https://medium.com/imgly/build-a-simple-real-time-video-editor-with-metal-for-ios-b62dbe6afd5e?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/b62dbe6afd5e</guid>
            <category><![CDATA[ios-metal]]></category>
            <category><![CDATA[video-editor]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[how-to]]></category>
            <dc:creator><![CDATA[tuhinavonpbd]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 02:12:15 GMT</pubDate>
            <atom:updated>2022-09-16T02:12:15.790Z</atom:updated>
            <content:encoded><![CDATA[<p>This post was originally posted on 30th August 2022.</p><p>Walter Tyree</p><p>In this tutorial you’ll see how to extract frames from live camera streams, regular movie files and streamed movie files and display them on a MetalKit View. Using Metal allows you to have a great deal of control over how the pixels are rendered and ensures that the GPU is used for rendering, which keeps from slowing down the CPU.</p><p>The tutorial code will always convert the video frames into CIImage objects before display. This is to help you adapt the code to your own applications. Applying filters, resizing and other effects are fast and easy when working with CIImage. Additionally, as long as you set your CIContext to the GPU, you can be sure that your code uses the GPU and the CPU efficiently.</p><p>When working with Video, Apple provides a number of frameworks that operate at different levels. For the higher level frameworks such as AVKit or CoreImage, the system determines when to use the GPU and when to use the CPU for rendering and computation. The higher-level frameworks also offer a tradeoff between ease of use and granularity of control. If you want to have direct access to tell the GPU how to render every pixel, then you will want to use Metal. Remember, though, that you are now responsible for keeping video and audio in sync, encoding and decoding data and determining a reasonable UI for your user. For many use cases, using a higher level framework is probably a better choice. Apple’s engineers have worked to ensure the graphics frameworks use the GPU and CPU in reasonable ways. However, when you need to use Metal, you you need it. So, let’s get started.</p><h4>Setting Up a MTKView</h4><p>An MTKView is a subclass of a UIView so it has a frame and bounds and other properties. Its drawing and rendering is backed directly by drawables and textures rendered on the GPU, so drawing to it can be quite fast. In addition to displaying video, you can render 3D model objects and graphics shaders, so for a graphics rich application it can be a powerful tool.</p><p>Before you can send data to the view it needs to be configured. MetalKit Views are still heavily influenced by UIKit, so if you are working in a SwiftUI project, you will need to wrap them in ViewRepresentable code.</p><pre>//MetalKit Variables<br>@IBOutlet var displayView: MTKView!<br>var metalDevice : MTLDevice!<br>var metalCommandQueue : MTLCommandQueue!</pre><pre>//CoreImage Variables<br>var ciContext : CIContext!<br>var filteredImage: CIImage?<br>var cleanImage: CIImage?</pre><pre>//get a reference to the GPU<br>metalDevice = MTLCreateSystemDefaultDevice()</pre><pre>//link the GPU to our MTKView<br>displayView.device = metalDevice</pre><pre>//link our command queue variable to the GPU<br>metalCommandQueue = metalDevice.makeCommandQueue()</pre><pre>//associate our CIContext with the metal stack<br>ciContext = CIContext(mtlCommandQueue: metalCommandQueue)</pre><pre>You will need to get a reference to the GPU of the iOS device. At least for now, iOS devices only have one GPU. Then you will need to link the displayView and the metalCommandQueue to the metalDevice. Finally we will link the ciContext to the GPU so that all of our image manipulation code will run in the same place.</pre><pre>//tell our MTKView that we want to call .draw() to make updates<br>displayView.isPaused = true<br>displayView.enableSetNeedsDisplay = false<br>//let it&#39;s drawable texture be writen to dynamically<br>displayView.framebufferOnly = false</pre><pre>//set our code to be our MTKView&#39;s delegate<br>displayView.delegate = self</pre><pre>In the code above, we set the MTKView to be in a isPaused state and do not enable setNeedsDisplay. This will ensure that it will only redraw when we explicitly tell it to redraw using a .draw() method in our delegate. By setting framebufferOnly to false you are telling the view that you will be writing to it multiple times and may also read from it.</pre><pre>Drawing in an MTKView</pre><pre>Now the MTKView is configured. The next step is to update the delegate methods. The MTKViewDelegate has two methods. If your code needs to respond to the view dimensions changing (to support device rotation, or if you want the user to be able to resize the window) make your adjustments in func mtkView(_ view: MTKView, drawableSizeWillChange size: CGSize). For this example we are only interested in the delegate method: func draw(in view: MTKView). The code below draws a CIImage to the MTKView. When showing video, we can extract each frame of the video as a CIImage</pre><pre>//create a buffer to hold this round of draw commands<br>guard let commandBuffer = metalCommandQueue.makeCommandBuffer() else {<br>return<br>}</pre><pre>//grab the filtered or a clean image to display<br>guard let ciImage = filteredImage ?? cleanImage else {<br>return<br>}</pre><pre>//get a drawable if the GPU is not busy<br>guard let currentDrawable = view.currentDrawable else {<br>return<br>}</pre><pre>//make sure frame is centered on screen<br>let heightOfImage = ciImage.extent.height<br>let heightOfDrawable = view.drawableSize.height<br>let yOffset = (heightOfDrawable - heightOfImage)/2</pre><pre>//render into the metal texture<br>self.ciContext.render(ciImage,<br>to: currentDrawable.texture,<br>commandBuffer: commandBuffer,<br>bounds: CGRect(origin: CGPoint(x: 0, y: -yOffset),<br>size: view.drawableSize),<br>colorSpace: CGColorSpaceCreateDeviceRGB())</pre><pre>//present the drawable and buffer<br>commandBuffer.present(currentDrawable)</pre><pre>//send the commands to the GPU<br>commandBuffer.commit()</pre><pre>For each pass of the draw method, we will create a new MTLCommandBuffer then we will get the MTKView&#39;s .currentDrawable which contains a texture we can send pixel data to. The texture will have a size and a color space. Though we are using Metal to render images to the screen, Metal can be used to send any valid commands to the GPU for things like computations. Once the buffer has been filled with commands it can be assigned to the drawable and committed. When the buffer is committed, the GPU will execute all of the commands. If another .draw() gets called while the buffer is being executed, the GPU will not interrupt the current buffer in order to start the new one.</pre><pre>The bounds of the render allow you to move where the CIImage gets displayed in the MTKView and resize the CIImage within the view. This can be valuable when compositing multiple images or video streams onto the same MTKView. Remember that unlike a UIView the origin point is the bottom left of the texture and CIImage.</pre><pre>Since iOS 11 Apple provides a new lighter weight API for sending renders to the buffer. Use whichever form makes sense to you.</pre><pre>//render into the metal texture<br>let destination = CIRenderDestination(mtlTexture: currentDrawable.texture,<br>commandBuffer: commandBuffer)<br>do {<br>try self.ciContext.startTask(toRender: ciImage, to: destination)<br>} catch {<br>print(error)<br>}</pre><pre>The CIRenderDestination has some other optional parameters such as height and width but will always display with an origin of 0,0. So, unlike the earlier call, if you need to rotate or change the dimensions of the image, you will need to do it to the CIImage earlier in the code. However, if your app always displays the video at full size in the MTKView this may be easier. Also the startTask call will return immediately, instead of waiting for other tasks on the CPU to complete.</pre><pre>It is important to remember that you can have any number of renders in the commandBuffer before the calls to .present and .commit. This means that the same MTKView can display video from multiple streams as well as static images or animations.</pre><pre>Working with Local Files</pre><pre>In order to extract individual frames from a local file, we can use an AVAssetReader to get pixel data to render in the MTKView</pre><pre>When using higher-level frameworks, a quick way to display a video file for playback is to load it into an AVPlayer. However, an alternative is to use an AVAssetReader to read the tracks and the individual frames from the video tracks.</pre><pre>let asset = AVAsset(url: Bundle.main.url(/service/forresource: &quot;grocery-train&quot;, withExtension: &quot;mov&quot;)!)<br>let reader = try! AVAssetReader(asset: asset)</pre><pre>guard let track = asset.tracks(withMediaType: .video).last else {<br>return<br>}</pre><pre>let outputSettings: [String: Any] = [<br>kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_32ARGB<br>]<br>let trackOutput = AVAssetReaderTrackOutput(track: track, outputSettings: outputSettings)<br>reader.add(trackOutput)<br>reader.startReading()</pre><pre>It is important that the outputSettings of the reader match the image format of the video track. If there is a mismatch the color may be off or the reader may be unable to extract a usable buffer. If your code is generating empty or black buffers, the outputSettings are the first place to troubleshoot. Once the reader starts reading then it can extract pixel buffers. You can use a while loop to get all of the buffers from the track and send them to the MTKView for display.</pre><pre>var sampleBuffer = trackOutput.copyNextSampleBuffer()<br>while sampleBuffer != nil {<br>guard let cvBuffer = CMSampleBufferGetImageBuffer(sampleBuffer!) else {<br>return<br>}<br>print(track.preferredTransform)<br>print(sampleBuffer?.outputPresentationTimeStamp)</pre><pre>//get a CIImage out of the CVImageBuffer<br>cleanImage = CIImage(cvImageBuffer: cvBuffer)<br>displayView.draw()</pre><pre>sampleBuffer = trackOutput.copyNextSampleBuffer()<br>}<br>}</pre><pre>In the code above, use CMSampleBufferGetImageBuffer to ensure that we have a valid image. Then assign the image to a CoreImage and execute the .draw method of the MTKView. Afterwards, get the next sample buffer. This will continue until the end of the track, when .copyNextSampleBuffer() will return nil.</pre><pre>In the code above, there are two print statements to note some valuable information that your app may want to store for later use. Remember, when working with buffers and the GPU directly, much of the higher-level metadata about the video is lost, so you’ll need to keep track of it in your code if you want to use it later. An image may be rotated because of the way it was originally generated in the video. The preferredTransform will provide data that your app can use to transform the image to the “proper” orientation before display. Additionally the outputPresentationTimeStamp tells when the image represented by the buffer appeared in the original video. This can be helpful when you are trying to sync individual frames back to audio tracks or if your app only wants to modify specific frames and then reinsert them into the original clip.</pre><pre>Working with Streams</pre><pre>In addition to local files, an app may want to use a video stream as the input. The process is largely the same, as there is a method to extract a CVPixelBuffer from an AVPlayer that is streaming. You can find the complete example code for pushing pixel buffers from a stream to an MTKView <a href="https://img.ly/blog/how-to-add-a-filter-to-a-video-stream-in-ios/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos">in this blog post about streaming</a>. However, the important part of the code perhaps looks familiar by now:</pre><pre>let currentTime = playerItemVideoOutput.itemTime(forHostTime: CACurrentMediaTime())<br>if playerItemVideoOutput.hasNewPixelBuffer(forItemTime: currentTime) {<br>if let buffer = playerItemVideoOutput.copyPixelBuffer(forItemTime: currentTime, itemTimeForDisplay: nil) {<br>let frameImage = CIImage(cvImageBuffer: buffer)<br>self.currentFrame = frameImage //a CIImage var<br>self.videoView.draw() //our MTKView<br>}<br>}</pre><pre>The code above uses a CADisplayLink to query the stream on a regular basis for new video frames. It then extracts a buffer and sends it over the MTKView for display.</pre><pre>Working with the Cameras</pre><pre>Much like a video stream with an AVPlayerItemVideoOutput to output pixel buffer data, a standard object to use with the camera is an AVCaptureVideoDataOutput object. First, you need to set up a standard capture session for either the front or back camera. Then attach a video data output object to the session.</pre><pre>videoOutput = AVCaptureVideoDataOutput()<br>let videoQueue = DispatchQueue(label: &quot;captureQueue&quot;, qos: .userInteractive)<br>videoOutput.setSampleBufferDelegate(self, queue: videoQueue)</pre><pre>if captureSession.canAddOutput(videoOutput) {<br>captureSession.addOutput(videoOutput)<br>} else {<br>fatalError(&quot;configuration failed&quot;)<br>}</pre><pre>Whenever the camera has collected enough data to generate a pixel buffer it will send that to its delegate. The delegate can then convert that data to a CIImage and send it to the MTKView to get rendered. The method in a AVCaptureVideoDataOutputSampleBufferDelegate would look like this.</pre><pre>func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {<br>//get a CVImageBuffer from the camera<br>guard let cvBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else {<br>return<br>}</pre><pre>//get a CIImage out of the CVImageBuffer<br>cleanImage = CIImage(cvImageBuffer: cvBuffer)<br>displayView.draw()<br>}</pre><pre>Going Further</pre><pre>In this tutorial, you saw how to extract pixel buffers from the camera, local file and remote streams and convert them to CIImage Then you saw how to render a CIImage to fill all or part of an MTKView. If your application needs to resize or apply filters to the images, you can do that before calling the .draw method of the MTKView. If the only reason you are considering using MKTViews is because of a Metal or OpenGL kernel you want to use, consider <a href="https://img.ly/blog/how-to-create-image-filters-in-ios/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos">our tutorial on how to wrap kernels into Core Image filters</a>.</pre><pre>If your application needs to gather streams of video, filter and then render them to the screen with precision, then drawing to an MTKView may be sufficient. However, if you want to let your users dictate how and where to filter the streams, then you may want to consider an SDK like <a href="https://img.ly/video-sdk?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos">VideoEditor SDK</a> or <a href="https://img.ly/creative-sdk?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos">CreativeEditor SDK</a>.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b62dbe6afd5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/build-a-simple-real-time-video-editor-with-metal-for-ios-b62dbe6afd5e">Build a Simple Real-Time Video Editor with Metal for iOS</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Stream Videos Using Javascript and HTML5]]></title>
            <link>https://medium.com/imgly/how-to-stream-videos-using-javascript-and-html5-9c28591e801e?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/9c28591e801e</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[video-editing]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[videos]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[tuhinavonpbd]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 02:04:19 GMT</pubDate>
            <atom:updated>2022-09-16T02:04:19.198Z</atom:updated>
            <content:encoded><![CDATA[<p>This post was originally posted on 29th August 2022.</p><p>Mark Vassilevskiy</p><p>If you would tell someone from the early 2000s what you’re about to do, they would be amazed and would give everything to understand how you did it. Because back then HTML was much simpler and didn’t even support video playback. So to stream your video inside of your browser you were forced to use some third-party services like Flash or Silverlight. Now we have HTML5 and new versions of JavaScript, and by combining these two new technologies you’ll end up with results that rival native applications. Streaming video inside of your web application nowadays is a breeze.</p><h4>The &lt;video&gt; tag</h4><p>You can easily start streaming your own video by using only one tag in HTML5. I’m talking about the &lt;video&gt; tag. It embeds a fully-fledged media player in the document and similar to the img tag accepts a path to the media we want to play inside the src attribute as well as accepting parameters for width and height.</p><p>In addition, there are video-specific properties such as whether the video should loop or autoplay and whether to display the default browser controls.</p><p>To handle the case of browsers not supporting the video tag you can provide fallback content inside the &lt;video&gt;&lt;/video&gt; tags.</p><p>&lt;iframe src=”https://codesandbox.io/embed/fast-rgb-03tbl5?fontsize=14&amp;hidenavigation=1&amp;theme=dark&quot; style=”width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;” title=”fast-rgb-03tbl5&quot; allow=”accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking” sandbox=”allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts”</p><h4>Combining with JavaScript</h4><blockquote>You can also combine this simple video streaming in HTML with JavaScript and make it more professional and be able to control your streaming manually. When you get an element from the DOM of a video tag, the object that you get exposes various methods and attributes which can be used for manipulating media content. Firstly, we need to access the DOM and declare an object which will be used for our manipulations. Now we can use myVideo to programmatically pause, change the playback rate and current time of the video.</blockquote><blockquote>const myVideo = document.getElementById(&quot;#video1&quot;);</blockquote><p>//pause the video myVideo.pause();</p><p>//Change the speed of playback myVideo.playbackRate = 3.0;</p><p>//Change current time myVideo.currentTime = 4;</p><p>However, most videos that we see on the web today such as YouTube, Twitch, or any other social media display much more complex behaviors than just changing playback speed or pausing the video. On YouTube, you can change the quality of your video, add subtitles, or even add features like autoplay if you have several other videos queued up and don’t want to switch it manually.</p><p>All those services actually still use a video tag. But instead of streaming a video file through the “src” attribute inside of your tag, they use powerful tools such as <a href="https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API">Media Source Extensions</a> or <a href="https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP">other adaptive streaming API</a> that will help stream your video more efficiently.</p><h4>What are Media Source Extensions (MSE)</h4><p>Media Source Extensions is a W3C specification that allows JavaScript to send streams to media codecs within Web browsers that support HTML5 video and audio that most browsers implement today. In other words, it allows JavaScript to generate streams and facilitate a variety of use cases like adaptive streaming and time-shifting live streams. It’s quite an advanced solution if you want to make your video playback more customizable and professional. MSE gives us finer grained control over how much and how often content is fetched, and some control over memory usage details, such as when buffers are evicted.</p><p>Wrap your resource via the Media Source Extensions API instead of dealing with the URL directly (We’ll talk more closely about it a little bit later).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TA5KqMNpVNR-FOYi.png" /></figure><h4>This specification was designed with the following goals:</h4><ul><li>Let JavaScript create a media stream regardless of how the media is fetched.</li><li>Leverage the browser cache as much as possible.</li><li>Provide requirements for byte stream format specifications.</li><li>Minimize the need for media parsing in JavaScript.</li></ul><p>As I mentioned, we are still using HTML5 video tags, and even more surprising is that we’ll still use the “src” attribute. Only this time, instead of adding a link to the video, add a link to the MediaSource object.</p><p>If you’re a little bit confused, then don’t worry, I’ll explain everything. To enable this type of use case, the W3C has defined a static method URL.createObjectURL. You can use this API to create a URL that directly points to a JavaScript object created on the client, rather than actually pointing to an online resource.</p><p>You can see how it works in this example:</p><pre>const videoTag = document.getElementById(&quot;my-video&quot;);</pre><pre>// creating the MediaSource, just with the &quot;new&quot; keyword, and the URL for it<br>const myMediaSource = new MediaSource();<br>const url = URL.createObjectURL(myMediaSource);</pre><pre>// attaching the MediaSource to the video tag<br>videoTag.src = url;</pre><pre>Now that you have a MediaSource, what should you do? That&#39;s not the only MSE specification. It also defines another concept, Source Buffers.</pre><pre><strong>Source Buffers</strong></pre><pre>The SourceBuffer interface <strong>represents a chunk of media to be passed into an HTMLMediaElement and played via a MediaSource object.</strong> To put the video directly into the MediaSource for playback, you’ll need Source Buffers. MediaSource contains one or more instances of it. Each is associated with a content type, such as Audio, Video, or both of them at the same time. Source buffers are all associated with a single MediaSource and are used in JavaScript to add video data directly to HTML5 video tags. Separating video and audio allows managing them separately on the server. Doing so has several advantages such as control over your traffic and increasing performance. This is how it works:</pre><pre>// -- Create a MediaSource and attach it to the video (We already learned about that) --</pre><pre>const videoTag = document.getElementById(&quot;my-video&quot;);<br>const myMediaSource = new MediaSource();<br>const url = URL.createObjectURL(myMediaSource);<br>videoTag.src = url;</pre><pre>// 1. add source buffers</pre><pre>const audioSourceBuffer = myMediaSource<br>.addSourceBuffer(&#39;audio/mp4; codecs=&quot;mp4a.40.2&quot;&#39;);<br>const videoSourceBuffer = myMediaSource<br>.addSourceBuffer(&#39;video/mp4; codecs=&quot;avc1.64001e&quot;&#39;);</pre><pre>// 2. download and add our audio/video to the SourceBuffers</pre><pre>// for the audio SourceBuffer<br>fetch(&quot;&lt;http://server.com/audio.mp4&gt;&quot;).then(function(response) {<br>// The data has to be a JavaScript ArrayBuffer<br>return response.arrayBuffer();<br>}).then(function(audioData) {<br>audioSourceBuffer.appendBuffer(audioData);<br>});</pre><pre>// the same for the video SourceBuffer<br>fetch(&quot;&lt;http://server.com/video.mp4&gt;&quot;).then(function(response) {<br>// The data has to be a JavaScript ArrayBuffer<br>return response.arrayBuffer();<br>}).then(function(videoData) {<br>videoSourceBuffer.appendBuffer(videoData);<br>});</pre><pre><strong>Adaptive Streaming</strong></pre><pre>Many video players have an &quot;auto quality&quot; feature that automatically selects quality based on network speed. If you have a slow internet connection then you’ll end up watching a video in the lowest resolution (probably 360p or even lower), on the other hand, if the connection is good then the video will be in the highest resolution (probably 1080p or even higher). It depends on how many options the specific video has. In addition, your hardware capability is also taken into account.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gaRxK1AOwknKeneJ.png" /></figure><pre>On the server side, we create different segments for every quality we want to support. For example, we would put the following files on our server:</pre><pre>./video/<br>├── ./360p/<br>|     ├── video_0.mp4<br>|     ├── video_1.mp4<br>|     └── video_2.mp4<br>├── ./720p/<br>|     ├── video_0.mp4<br>|     ├── video_1.mp4<br>|     └── video_2.mp4<br>└── ./1080p/<br>├── video_0.mp4<br>├── video_1.mp4<br>└── video_2.mp4</pre><pre>The web player then automatically selects the correct video file to load when the network or CPU state changes. This is entirely done in JavaScript. For video segments, it could, for example, look as follows:</pre><pre>/**</pre><ul><li>We first derive the desired quality from the bandwidth</li><li>Then pass it to the pushVideoSegment()</li><li>which fetches each segment with the desired quality in turn and returns a promise **/</li></ul><pre>function pushVideoSegment(nb, wantedQuality) {<br>const url = &quot;&lt;http://my-server/video/&gt;&quot; +<br>wantedQuality + &quot;/segment&quot; + nb + &quot;.mp4&quot;);<br>return fetch(url)<br>.then((response) =&gt; response.arrayBuffer());<br>.then(function(arrayBuffer) {<br>videoSourceBuffer.appendBuffer(arrayBuffer);<br>});<br>}</pre><pre>/**</pre><ul><li>Translate an estimated bandwidth to the right audio</li><li>quality as defined on server-side.</li><li>@param {number} bandwidth</li><li>@returns {string} */ function fromBandwidthToQuality(bandwidth) { return bandwidth &gt; 320e3 ? “360p” : “720p”; }</li></ul><pre>// first estimate the bandwidth. Most often, this is based on<br>// the time it took to download the last segments<br>const bandwidth = estimateBandwidth();</pre><pre>const quality = fromBandwidthToQuality(bandwidth);</pre><pre>pushVideoSegment(0, quality)<br>.then(() =&gt; pushVideoSegment(1, quality))<br>.then(() =&gt; pushVideoSegment(2, quality));</pre><pre>Conclusion</pre><pre>Congratulations, you’ve learned multiple ways how to stream a video file into your browser. We have explored several tools that are helping you not just change some video parameters by using vanilla JS and HTML, and also Media Source Extensions (MSE) that are helping all developers around the world to build professional web players which you’re using yourself, such as YouTube, Twitch, TikTok and many others.</pre><pre>If you want to give your users the ability to also edit videos within your mobile application check out our <a href="https://img.ly/video-sdk?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=howtos">VideoEditor SDK</a> offering features such as trimming, transforms, video composition and more. It’s fully customizable to match the look and feel of your app and the most performant solution on the market.</pre><pre>If you have questions, feedback or comments reach out to us on <a href="https://twitter.com/imgly">Twitter</a>.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c28591e801e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/how-to-stream-videos-using-javascript-and-html5-9c28591e801e">How to Stream Videos Using Javascript and HTML5</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IMG.LY is Going Public… with our Product Roadmap]]></title>
            <link>https://medium.com/imgly/img-ly-is-going-public-with-our-product-roadmap-36617d54d700?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/36617d54d700</guid>
            <category><![CDATA[product-development]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[photo-editor]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[tuhinavonpbd]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 01:48:58 GMT</pubDate>
            <atom:updated>2022-09-16T01:48:58.808Z</atom:updated>
            <content:encoded><![CDATA[<p>This post was originally posted on 16th August 2022.</p><p>Jan Bussieck</p><p>We recently launched our <a href="https://roadmap.img.ly/tabs/1-released">public product roadmap</a> allowing our customers and would-be customers to explore what we <strong>shipped</strong> with each CreativeEditor SDK release, what we are <strong>currently building </strong>for the next, what features, and enhancements are <strong>coming up</strong> and which are still in the <strong>planning phase</strong>.</p><p>More importantly, customers can give us feedback on which features they prioritize most highly, and propose new features and ideas on how to improve our SDKs to better fit their needs.</p><p>Many companies such as <a href="https://portal.productboard.com/gf59pkqrbumehmcn7ueixwbu/tabs/1-under-consideration">Front </a>or <a href="https://github.com/orgs/github/projects/4247">GitHub</a> have opened up their roadmaps to their users, so why was this an important, worthwhile step for us?</p><p>Let’s take a step back. IMG.LY is a B2D company, we build SDKs for any creative editing use case imaginable, from <strong>photo</strong> and <strong>video</strong> editing to creating advanced <strong>designs</strong> and <strong>templates</strong>.</p><p>Since we power the creative editing capabilities of our customers’ applications, we are one step removed from the end users of our product.</p><p>This has two important implications.</p><p>Firstly, we need to work closely with our customers and understand their use cases and constraints. We cannot recklessly ship features and make changes like the code-slinging cowboys we might imagine ourselves to be.<br>Our customers’ businesses to a significant degree depend on our judicious and careful planning.</p><p>Our relationship does not end with a transaction, rather we become partners in crime. As such we have an obligation to ensure they can smoothly integrate changes we make to the SDK into their product and be cognizant of the fact that they have a roadmap, too, with its own constraints and priorities.</p><p>Secondly, our customers’ voices are amplified by the thousands — in some cases millions — of end users they represent. That means we must open as many channels as possible to hear them.</p><h4>Launch Features &amp; Drive Adoption</h4><p>Back in the day (really two weeks ago) after a cycle of planning, designing and developing, we would ship a release and announce it by sending an email to our list of customers and publish a blog post and a more or less complete changelog on GitHub.</p><p>That was not enough.</p><p>Every feature and product improvement that you ship is a tiny launch, and you do not want to launch to crickets.</p><p>Our public roadmap affords us the obvious benefit that we can communicate to customers in advance what is coming down the pike. We decided to go beyond simply mentioning a feature in dry technical terms and added graphical illustrations, as well as highlighting benefits to end users. Our goals here are not only to inform, but to educate, demonstrate value and drive adoption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RteaOOQmfs58gCc9.png" /></figure><h4>Building the Right Features</h4><p>There is a common saying in product management that goes something like this, “If you ask your users what they want, you end up shipping faster horses instead of iPhones” (or something along those lines).</p><p>While there is truth to it, and we do have our own vision for our product suite, incorporating customer feedback from sales and support / customer success is an integral part of our product development process.</p><p>There are, however, problems with relying exclusively on these two avenues.</p><p>On one end of the spectrum, feature requests from the sales side can create a misplaced sense of urgency and often run the risk of drowning out the voice of existing customers.</p><p>“We just need feature x to close the deal” it’s an all too familiar refrain, but deals seldom hinge on any one particular feature. In fact, requirements in this phase are often quite inchoate and subject to change.</p><p>On the other end, feedback from support comes at a stage when some kind of friction, some pain has already occurred. While great for catching and fixing bugs, often customers utilize an API in a way, we did not intend to realize a certain feature and consequently run into problems.</p><p>A great example is our serialization API, allowing users to save and restore the state of the editor. Primarily built to enable cross device/platform interoperability and save work in progress.</p><p>Support would get request after request about this feature before we realized what our customers actually wanted was templating, a feature already in the works that we just hadn’t communicated yet.</p><p>Now that we have a public roadmap in place, potential customers and customers alike know what is coming and vote to prioritize features.</p><p>Not only can our team rest assured that what they are building is being eagerly anticipated, but we also garner more frequent and more balanced input from every stakeholder.</p><h4>Customer Acquisition: Addressing Objections</h4><p>Our SDKs form an essential part of our customers’ products.</p><p>The decision to purchase a license often comes at the end of assiduous evaluation, due diligence and weighing the pros and cons of make vs buy. Some of the questions that arise naturally during this process are</p><p>“Do I have any influence on product development?”</p><p>“Will my concerns find an open ear?”</p><p>“How actively is the product being improved?”</p><p>“Do we stand to profit from the SDK in the long run?”</p><p>“When will the missing feature be taken care of?”</p><p>Being open about our product roadmap is the best way to answer all of them and address these concerns as early as possible.</p><p>What is more, now features we haven’t even shipped can become selling points and conversation starters.</p><p>By demonstrating a commitment to continuous improvement in a customer facing manner, your daily business, that is the active and focused development of your product, can become a differentiating factor making you stand amongst your competitors.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36617d54d700" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/img-ly-is-going-public-with-our-product-roadmap-36617d54d700">IMG.LY is Going Public… with our Product Roadmap</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CE.SDK v1.7.0 Release and Roadmap]]></title>
            <link>https://medium.com/imgly/ce-sdk-v1-7-0-release-and-roadmap-f2ffc409cd98?source=rss----b4d208c80bdd---4</link>
            <guid isPermaLink="false">https://medium.com/p/f2ffc409cd98</guid>
            <category><![CDATA[roadmaps]]></category>
            <category><![CDATA[web-applications]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[release-notes]]></category>
            <category><![CDATA[creative-editor]]></category>
            <dc:creator><![CDATA[tuhinavonpbd]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 01:32:05 GMT</pubDate>
            <atom:updated>2022-09-16T01:32:05.710Z</atom:updated>
            <content:encoded><![CDATA[<h4>This post was originally posted on 9th August 2022.</h4><p>Malte Baumann,Daniel Hauschildt</p><p>Today, we are thrilled to highlight the best new features and changes in CE.SDK since our <a href="https://img.ly/blog/creative-editor-sdk-v_1_6_0-release-notes/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">v1.6.0 Release</a>. We have also published our <a href="https://roadmap.img.ly/"><strong>Product Roadmap for CE.SDK</strong></a> to share our vision and direction for upcoming releases. This roadmap will let you know ahead of time what features you can expect from us and accelerate your product planning and development. We are excited to hear your feedback and suggestions to build more powerful features for your application!</p><h4>CE.SDK v1.7.0</h4><p>This release includes:</p><ul><li>Auto Close Option in Web UI Configuration for Asset Libraries</li><li>Custom URI Resolver</li><li>Improving Mobile Touch Support</li><li>Rotation of Groups and Hierarchies</li><li>Custom Asset Source UI</li><li>Disconnecting UI Variants from Roles</li><li>Asset Source ApplyAsset API</li><li>Blur API</li><li>Effects API</li><li>Image Fills API</li><li>Image Straighten API</li><li>Improved Group Selection and API</li><li>Scopes API</li><li>Shadows API</li><li>Zoom API</li></ul><h4>Auto Close Option in Web UI Configuration for Asset Libraries</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*PFbzj8bW7Mnp0ibd.gif" /><figcaption>Should it stay or should it go? Have control over your library behavior with this update.</figcaption></figure><p>There are no one-size-fits-all solutions for the behavior of asset library panels after an action was triggered. It depends on the use case and might vary between the panels and the available screen space. Thus, this is now configurable.</p><h4>Custom URI Resolver</h4><p>Custom URI Resolvers give you full control over how URIs should be resolved. You can create custom storage backends and even resolve different resolution images in different instances. Find more information in our <a href="https://img.ly/docs/cesdk/web/guides/resolve-custom-URI/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">documentation</a>.</p><h4>Improving Mobile Touch Support</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oaXYLC06MwYqtKYD.png" /><figcaption>Great design-to-go: improved mobile touch support.</figcaption></figure><p>Input handling was streamlined to handle both touch and mouse input efficiently. On touch devices, all handles maintain the recommended minimum size for touch input and are intelligently hidden to minimize overlap. Thanks to this mechanism, resizing and rotating are always a breeze.</p><h4>Rotation of Groups and Hierarchies</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cUy4lGm36RBSDxhh.png" /><figcaption>Simplify your design process by grouping elements and edit them altogether.</figcaption></figure><p>The engine and user interface add options for rotating groups and design blocks with children. This allows changing the rotation of multiple elements at once quickly.</p><h4>Custom Asset Source UI</h4><p>Instead of fixed entry points such as “Images,” “Stickers,” or “Shapes,” we want to enable custom and flexible entry points. Until today, we tied them to a block type, which is currently only relevant when users add an asset to the scene.</p><h4>Moving from Roles to Abilities: Disconnecting UI Variants from Roles</h4><p>Before the change, the Advanced UI was tied to the creator role and the Default UI was tied to the Adopter Role. This is now no longer the case. The scopes and editing options are still controlled by the abilities of the current role.</p><h4>Shadows in Advanced UI</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_VamrSD_Uu3HV5Ul.png" /></figure><p>With this update, we roll out the long-awaited ability to apply shadows to elements in our Advanced UI. Realistic drop shadow effects add more depth to your designs with a few clicks — no other editor is needed.</p><h4>Blur API</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LSzDNEwNpQvwzQJx.png" /></figure><p>We introduce <a href="https://img.ly/docs/cesdk/web/guides/api/block/blur/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">new APIs</a> to modify the blur for images and other blocks. This change allows programmatic access to add blur effects in automation cases and when building your own UI.</p><h4>Effects API</h4><p>We introduce <a href="https://img.ly/docs/cesdk/web/guides/api/block/effects/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">new APIs</a> to modify the effect stack for shapes and other blocks. This allows programmatic access to effects like adjustments, LUT filters, and many more.</p><h4>Image Fills API</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cdx4jtEbqSQ31i11.png" /></figure><p>Currently, you can only access and use images with the image block. However, pages or vector shapes could use more than just a color or gradient fill. Therefore, we broaden the concept of fills by allowing every block to have an image fill, e.g., pages. This change will enable building a more natural photo- or video-editor experience. <a href="https://img.ly/docs/cesdk/web/guides/api/block/fills/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">Documentation</a>.</p><h4>Image Straighten API</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ipBvoy18dtSNJsi3.png" /></figure><p>We are extending the <a href="https://img.ly/docs/cesdk/web/guides/api/block/modify-properties/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes#crop">Image Crop API</a> to allow straightening, flipping, and rotating images during cropping. This change allows more fine-grained control.</p><h4>Improved Group Selection and API</h4><p>There are multiple options to select blocks inside a group:</p><ul><li>selecting a group first and with each click select one block deeper in the hierarchy</li><li>selecting an element under the cursor directly, neglecting the hierarchy</li></ul><p>Previously, we defaulted to different behaviors depending on the user’s role. Now, this is configurable and also customizable during runtime via APIs. Therefore, it’s up to the implementor how the selection should work.</p><h4>Scopes API</h4><p>We introduce <a href="https://img.ly/docs/cesdk/web/guides/api/scopes/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">new APIs</a> to modify the scopes for blocks. This update allows programmatic access to change the scopes for users and allows control over the possible edits a user can make to a scene.</p><h4>Shadows API</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CL4e_e6dPv6VxagT.png" /></figure><p>We introduce <a href="https://img.ly/docs/cesdk/web/guides/api/block/drop-shadow/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">new APIs</a> to modify shadows for images and other blocks. This change allows programmatic access to add shadow effects to be used in automation cases and when you build your UI.</p><h4>Zoom API</h4><p>We introduce <a href="https://img.ly/docs/cesdk/web/guides/api/scene/scene-zoom/?utm_source=imgly&amp;utm_medium=blog&amp;utm_campaign=releasenotes">new APIs</a> to modify the current zoom level. This allows programmatic access to change the current zoom easily for automation use-cases or for building your own user interface.</p><h4>Product Roadmap</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xGCYKyn_mBmvGKC0.png" /></figure><p>As mentioned before, we are happy to publish our <a href="https://roadmap.img.ly/">Product Roadmap</a> to let you in on our new features and enhancements for CE.SDK. This way, we can elaborate our decisions and plans for the product and how you can benefit while allowing you to give us feedback and indicate the importance of particular features.<br>Now that you know what’s coming down the pike, you can prepare for the release of significant improvements and new features such as <a href="https://roadmap.img.ly/c/70-web-video-support"><strong>Video Support for Web</strong></a> or <a href="https://roadmap.img.ly/c/69-native-ios-platform-support"><strong>Native iOS Support</strong></a> well in advance.</p><h4>Thanks for reading! Let us know what you think on <a href="https://twitter.com/imgly">Twitter</a>! To stay in the loop, subscribe to our <a href="https://photoeditorsdk.us13.list-manage.com/subscribe?u=dc9f652839dbb620d14d6d28d&amp;id=04a306e4b2">Newsletter</a>.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2ffc409cd98" width="1" height="1" alt=""><hr><p><a href="https://medium.com/imgly/ce-sdk-v1-7-0-release-and-roadmap-f2ffc409cd98">CE.SDK v1.7.0 Release and Roadmap</a> was originally published in <a href="https://medium.com/imgly">IMG.LY</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>