<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: DynaPictures</title>
    <description>The latest articles on DEV Community by DynaPictures (@dynapictures).</description>
    <link>https://dev.to/dynapictures</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F898959%2Fd3517fbb-7623-47a8-b440-e21ad2544c24.png</url>
      <title>DEV Community: DynaPictures</title>
      <link>https://dev.to/dynapictures</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dynapictures"/>
    <language>en</language>
    <item>
      <title>Automated Image Generation for Business. Real Examples from Image Generation Platform.</title>
      <dc:creator>DynaPictures</dc:creator>
      <pubDate>Mon, 22 Aug 2022 09:39:41 +0000</pubDate>
      <link>https://dev.to/dynapictures/automated-image-generation-for-business-real-examples-from-image-generation-platform-42nc</link>
      <guid>https://dev.to/dynapictures/automated-image-generation-for-business-real-examples-from-image-generation-platform-42nc</guid>
      <description>&lt;p&gt;As a marketing specialist or business owner, you experience the need to promote your products and services, stand out from the crowd, and drive more traffic and conversions. Automated image generation can be a huge help in achieving this goal, as it turns manual daily toil into a feasible, efficient, - and cost-efficient process. Most importantly, this helps to produce more visual content and boost exposure to potential leads with the same team resources.&lt;/p&gt;

&lt;p&gt;As markets become more saturated and competition becomes fierce, the need for differentiation seems to be required more than ever before. One of the strategies to apply in this environment is implementing new technologies and techniques to get ahead. We are not talking AR/VR just yet, since delivering memorable visual content will already be a game-changer.&lt;/p&gt;

&lt;p&gt;Visual content is easier to consume and helps to show your products or services in the context relevant to potential customers. Thus, increasing the chances that your message hits the sweet spot, helping your user make their desired action. Below are some stats on the effectiveness and marketing value of visual content (&lt;a href="https://dynapictures.com/images/gh/auto-image-generator-1.1.png?ref=hackernoon.com"&gt;source&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--85Fi3O0L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dynapictures.com/images/gh/auto-image-generator-1.1.png%3Fref%3Dhackernoon.com" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--85Fi3O0L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dynapictures.com/images/gh/auto-image-generator-1.1.png%3Fref%3Dhackernoon.com" alt="Effectiveness of visual content stats" width="880" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read more on how using an image generation platform such as DynaPictures helps scale your marketing efforts and achieve more results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Image generation for E-commerce
&lt;/h2&gt;

&lt;p&gt;Generally, as an online shop owner, you have thousands of products in your catalog. Showcasing your products by combining multiple product images into one banner, and adding discounts and product highlights to the banner helps to capture visitors’ attention and increase sales. Producing banners for thousands of products would take lots of time and money. This is a hidden opportunity that one can leverage by generating thousands of banners with special offers and placing them in the shop, on social media, and on other online channels.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3-HXVQzu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/243moi5mipvc793hicxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3-HXVQzu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/243moi5mipvc793hicxw.png" alt="Image generation for E-commerce" width="880" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are many other uses for e-commerce marketers or owners so that they can benefit from dynamic image generation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Show how your goods (pictures, art, furniture, etc) look in the customer's interior&lt;/li&gt;
&lt;li&gt;Show how pictures look with different frames&lt;/li&gt;
&lt;li&gt;Show how clothes look on different people&lt;/li&gt;
&lt;li&gt;Show how the logo looks on merchandise (and enable print on demand)&lt;/li&gt;
&lt;li&gt;Show how your tools look on your prospect’s website&lt;/li&gt;
&lt;li&gt;Show how wheels look on a car.&lt;/li&gt;
&lt;li&gt;Generate images to show how your goods (pictures, art, furniture, etc) look in the customer's interior.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---8HvplX8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61ng8q9v8sn78n6zd37c.png" alt="Image generation ecommerce" width="880" height="495"&gt;
Can you spot the pattern here?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach brings the following benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increased conversion rate, as customers can test your goods out immediately&lt;/li&gt;
&lt;li&gt;Increased customer satisfaction, because they see what they buy&lt;/li&gt;
&lt;li&gt;Decreased returns and chargebacks, because they get exactly what they ordered.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Image generation for email marketing
&lt;/h2&gt;

&lt;p&gt;As an email marketer or online shop owner, you have a data source with customers’ variables and your product data or special offers. Simply connect the data source with the customer's name to the product data and special offers, then generate images with the personalized offers.&lt;/p&gt;

&lt;p&gt;The main advantages of automated image creation for email campaigns are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;- Increased conversion rates with a personalized offer (e.g. sending pictures tagged with wordings from the client’s industry significantly increases conversions according to the “&lt;a href="https://www.amazon.com/Data-Driven-Marketing-Metrics-Everyone-Should/dp/0470504544?ref=hackernoon.com"&gt;Data-Driven Marketing&lt;/a&gt;” book)&lt;/li&gt;
&lt;li&gt;- Increased customer engagement&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using personalized images in emails also allows your image to look professional across all browsers, devices, and email clients. There's no need to worry about testing your emails across all email clients or having broken layered images result in a poor customer experience.&lt;/p&gt;

&lt;p&gt;Feel free to take a look at other campaigns you can launch with automated image generation in email campaigns.&lt;/p&gt;

&lt;p&gt;Here are some examples of customized follow-up emails you can create with DynaPictures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send the product your customer was interested in with personalized text and coupon code.&lt;/li&gt;
&lt;li&gt;Send personalized images such as a coffee cup, laptop with a website, etc. depending on the customer segment or profile.&lt;/li&gt;
&lt;li&gt;Send the most suitable pictures based on persona and customer journey.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AVheHr2d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0q2ot6l17mgb64474ls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AVheHr2d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0q2ot6l17mgb64474ls.png" alt="Image generation email" width="880" height="757"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Other use cases can include the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate hyper-personalized welcome and follow-up email banners&lt;/li&gt;
&lt;li&gt;Generate hundreds of image variations for bulk emails (with discount values etc.)&lt;/li&gt;
&lt;li&gt;Bonus hack: Dynamically tag pictures with data sources from 3rd party vendors and public data, e.g. &lt;a href="https://www.crunchbase.com/"&gt;Crunchbase&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most effective domains for applying this approach include E-commerce, SaaS, email outreach, targeting, re-targeting, etc.&lt;/p&gt;

&lt;p&gt;Using image personalization in email campaigns enables you to use pictures as a personal touch, drive engagement in your prospects and successfully convert them into loyal customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Image generation for social media
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h8if0Gnm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/umas4h282vkiufjudjg6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h8if0Gnm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/umas4h282vkiufjudjg6.png" alt="Image generation social media" width="880" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Organic social media reach is diminishing. If people are not engaging with your posts you are at risk of your organic reach dropping from 1-2% lower. Visual content helps you get attention, it stops users from scrolling past your posts and allows them to engage with your content.&lt;/p&gt;

&lt;p&gt;Social media marketers usually spend 1-2 weeks creating a social media feed for the next 3-4 months. Connecting a database of quotes, holidays, and events to DynaPictures will result in quick and effective social banner creation. You can generate banners in hours instead of weeks!&lt;/p&gt;

&lt;p&gt;Here is what one of DynaPictures customers has to say about their experience with using our platform for automating social media marketing campaigns:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Took about 15 minutes to create an automated social media picture/quote/meme factory! This was a huge timesaver and it required zero troubleshooting, it just worked the first time through. Seriously, what am I going to do with the rest of my afternoon?" &lt;br&gt;
Craig Sherman, CEO @ Sociamonials&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Below we cover some social media marketing cases when the ability to generate images in bulk is crucial for you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bulk image generation for paid social media campaigns of varying sizes for different audience segments, for multiple campaigns, social networks, and A/B tests.&lt;/li&gt;
&lt;li&gt;Creative engaging content for all your social media such as quotes, stories, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JWOlMDg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6sm3kzfezjgtvcfhji6a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JWOlMDg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6sm3kzfezjgtvcfhji6a.png" alt="Image generation banners" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a result, you save 2 to 6 hours per working day while growing your social media presence and engagement with more content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creation of visual reports and results tables directly from your data
&lt;/h2&gt;

&lt;p&gt;If you are in the financial, sports, or betting business then you know that sports matches happen frequently and at any time of the day. In any case, users want to see the results immediately.&lt;/p&gt;

&lt;p&gt;You can hire a team of designers working 24/7 or you can automate image generation.&lt;/p&gt;

&lt;p&gt;Designers can make human errors and your users could be frustrated if you skew the result.&lt;/p&gt;

&lt;p&gt;Naturally, you’d like to transform raw data into informative infographics, pie charts, and other visuals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sports matches results&lt;/li&gt;
&lt;li&gt;Stock trading data&lt;/li&gt;
&lt;li&gt;Currency exchange rates&lt;/li&gt;
&lt;li&gt;Trend forecasts, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eL7Y4zSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1fv3xeexq8jh5bgc593.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eL7Y4zSH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1fv3xeexq8jh5bgc593.png" alt="Image generation based on data" width="880" height="761"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The advantages of this approach are the automated creation of social media, emails and data feed that drive customer engagement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Webinar invitations and event announcements
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yF16uoAV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jud083iib1vbzge6iceb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yF16uoAV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jud083iib1vbzge6iceb.png" alt="Generate webinar invitations" width="880" height="1082"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a webinar maker, you likely create images for your webinar announcement manually. Webinars and online events happen regularly, but the only things that change in the banner are the date, time, and topic. This is a perfect example of how automated image generation can help.&lt;/p&gt;

&lt;p&gt;Simply create a spreadsheet with all the topics and dates, import it to DynaPictures and you are ready to go!&lt;/p&gt;

&lt;p&gt;You can even automate it with Zapier to be published across your social media or email automatically.&lt;/p&gt;

&lt;p&gt;There are numerous cases when you need to generate invitations or announcements images en masse:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Announce online or offline events, webinars, etc.&lt;/li&gt;
&lt;li&gt;Send personalized invitations&lt;/li&gt;
&lt;li&gt;Create personalized badges and tickets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C2ozMXzL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrs14c4va8z68yczhat0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C2ozMXzL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrs14c4va8z68yczhat0.png" alt="generate badges. generate tickets" width="880" height="675"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using DynaPictures you can get the following advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Boost your events bookings&lt;/li&gt;
&lt;li&gt;Increase show-up rate&lt;/li&gt;
&lt;li&gt;Let every visitor feel special&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see, even something as ordinary as a webinar invitation can be made unique and feel personal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Image personalization for certificates
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---Ua1PcYN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajotjq3tb2cm7ukybzwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Ua1PcYN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajotjq3tb2cm7ukybzwg.png" alt="Generate certificates" width="880" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No doubt, receiving a certificate makes someone feel special. It describes a significant effort invested in achieving a certain goal, so it must be personal, and unique to its owners. However, for the issuing party, they are a daily part of their routine and can benefit from automated image creation.&lt;/p&gt;

&lt;p&gt;Here are just several examples of how to use dynamically-generated images:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Issuing certificates for online course participants.&lt;/li&gt;
&lt;li&gt;Issuing “Thank you!” certificates for loyal customers, active clients, etc.&lt;/li&gt;
&lt;li&gt;Adding gamification and boosting engagement. You can issue certificates automatically, when users reach some level when working with the product - e.g. posted X comments, uploaded X documents, stayed for X years/months.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this approach, you save time and effort on automated certificate generation while strengthening relations with customers by commending their loyalty.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use DynaPictures?
&lt;/h2&gt;

&lt;p&gt;Using DynaPictures is very simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dynapictures.com/b/p/register"&gt;Create account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Choose or create a template&lt;/li&gt;
&lt;li&gt;Customize layers&lt;/li&gt;
&lt;li&gt;Launch auto-generation&lt;/li&gt;
&lt;li&gt;Download and enjoy!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;There are multiple solutions for automated image generation on the market. Why use DynaPictures?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free plan and affordable pricing (great deal compared to competitors)&lt;/li&gt;
&lt;li&gt;Unlimited traffic (compared with BannerBear)&lt;/li&gt;
&lt;li&gt;Easy to integrate with other tools using API or No-Code tools (Zapier, Integrately, Pabbly, etc.)&lt;/li&gt;
&lt;li&gt;DynaPictures provides some advanced features:

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dynapictures.com/blog/automate-with-spreadsheets-and-auto-generate-many-images-at-once"&gt;Image generation from a spreadsheet&lt;/a&gt; allows you to automate images in bulk from spreadsheet files&lt;/li&gt;
&lt;li&gt;One of the fastest tools for automated image creation&lt;/li&gt;
&lt;li&gt;New powerful AI features are coming (face detection, automated background removal, etc)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zR9oHNwD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p75xukcg9n587e5u05m5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zR9oHNwD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p75xukcg9n587e5u05m5.png" alt="Image generation API" width="880" height="373"&gt;&lt;/a&gt;&lt;br&gt;
By using &lt;a href="https://dynapictures.com/"&gt;DynaPictures&lt;/a&gt;, you treat your pictures as a layered cake with a cherry on top:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every layer of a picture can be changed separately, allowing you to create numerous combinations of elements. This can be done manually or via API to ensure you can generate images in bulk for your website content and/or marketing campaigns.&lt;/li&gt;
&lt;li&gt;DynaPictures is just like your other favorite No-Code tools. You don’t have to be a developer to make the most out of it — everything is self-explanatory and easily configurable, and also provides a powerful range of image creation tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To sum it all up, automated image generation in E-commerce is a great way to maximize the efficiency of your marketing efforts, while providing a memorable, personalized, and positive customer experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To wrap it all up, automated image generation is an efficient and cost-effective solution for creating impactful, memorable, and diverse marketing content, which supports your business growth.&lt;/p&gt;

&lt;p&gt;In this article, we shared some image auto-generation ideas and a brief guide on how to use the &lt;a href="https://dynapictures.com/"&gt;image generation software&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;How did automated image creation work for you before? What automation trends do you see?&lt;/p&gt;

&lt;p&gt;Share your insights in the comments below!&lt;/p&gt;

&lt;p&gt;This article was originally published on &lt;a href="https://hackernoon.com/how-to-use-automated-image-generation-for-your-business-get-inspired-by-real-examples"&gt;HackerNoon&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>startup</category>
      <category>imagegeneration</category>
    </item>
    <item>
      <title>3 Methods of Automatic Image Generation: Image Generation API, Libraries, and Puppeteer Screenshots</title>
      <dc:creator>DynaPictures</dc:creator>
      <pubDate>Fri, 19 Aug 2022 12:45:21 +0000</pubDate>
      <link>https://dev.to/dynapictures/3-methods-of-automatic-image-generation-image-generation-api-libraries-and-puppeteer-screenshots-38e3</link>
      <guid>https://dev.to/dynapictures/3-methods-of-automatic-image-generation-image-generation-api-libraries-and-puppeteer-screenshots-38e3</guid>
      <description>&lt;p&gt;In this article, we share our experience generating millions of images with &lt;a href="https://dynapictures.com/"&gt;DynaPictures&lt;/a&gt; in the last months. We will go over possible solutions needed to generate images programmatically, possible caveats and pitfalls you may hit, as well as the best practices that emerged from our experience using dynamic image generation.&lt;/p&gt;

&lt;p&gt;So let us dive in and discuss what image generation is and then review the available options.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Image Generation?
&lt;/h2&gt;

&lt;p&gt;Image generation is the process of creating images automatically. It usually requires the creation of an image template first and specifying the basic image layout, colors, etc. Then, during the generation process, you would have to specify texts and images that will be added to the image template as overlays programmatically and a final image is produced.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h5imG_uw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dynapictures.com/images/gh/dynapictures-image-generation-placeholder.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h5imG_uw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dynapictures.com/images/gh/dynapictures-image-generation-placeholder.png" alt="Dynamic image generation" width="880" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Generate Images: Available Options
&lt;/h2&gt;

&lt;p&gt;When you need to add text to an image or overlap one image over another, here are the options available today:&lt;/p&gt;

&lt;h2&gt;
  
  
  Option #1: Advanced Image Generation API
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mcQwcfmJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8l3ry7mu7kf0fo9np6ss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mcQwcfmJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8l3ry7mu7kf0fo9np6ss.png" alt="Image Generation API" width="880" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dynapictures.com/"&gt;Image generation software&lt;/a&gt; like DynaPictures can be used via &lt;a href="https://dynapictures.com/image-generation-api"&gt;API&lt;/a&gt; to generate images on the fly. You still need to create image templates for the designs that you want to automate, but you don’t need to write code for that. You use a Canva-like editor to create your design, and then just send REST API requests to replace different parts in the design and generate a final image.&lt;/p&gt;

&lt;p&gt;Each object in your design is a layer that can be customized via API.&lt;/p&gt;

&lt;p&gt;Let's take a simple image template as an example. Each template contains a canvas layer, which is a system layer that’s needed to specify image dimensions and background color. Then, we add text and image layers to be able to specify a title and an image below it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--imND-tCc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dz2cdn1.dzone.com/storage/temp/16019279-dynapictures-image-template.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--imND-tCc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dz2cdn1.dzone.com/storage/temp/16019279-dynapictures-image-template.png" alt="Simple image generation template" width="880" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then the sample API request will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST http://api.dynapictures.com/designs/12345

With body:
{
  "format": "jpeg",
  "metadata": "",
  "params": [
    {
      "name": "canvas",
      "backgroundColor": "rgb(103,176,197)"
    },
    {
      "name": "title",
      "text": "Explore New Zealand"
    },
    {
      "name": "image",
      "imageUrl": "https://images.unsplash.com/photo-1508971607899-a238a095d417?ixlib=rb-1.2.1&amp;amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;amp;auto=format&amp;amp;fit=crop&amp;amp;w=2274&amp;amp;q=80"
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;a href="https://dynapictures.com/image-generation-api"&gt;image generation API&lt;/a&gt;, we specify the image format that we need (jpeg), and then the list of parameters for the layers in the template. We change the background color of the canvas, the text content of the title layer, as well as specify another image for an image layer.&lt;/p&gt;

&lt;p&gt;Once the request is sent, we get a response from the server that will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP
{
  "id": "42dfd61224",
  "templateId": "9001f2512d",
  "imageUrl": "https://api.dynapictures.com/8eb9e4869b/42dfd61224.jpeg",
  "thumbnailUrl": "https://api.dynapictures.com/8eb9e4869b/42dfd61224-thumb.jpeg",
  "retinaThumbnailUrl": "http://localhost:9333/8eb9e4869b/42dfd61224-thumb-2x.jpeg",
  "fileName": "42dfd61224.jpeg",
  "metadata": "",
  "width": 650,
  "height": 500
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can open or download a generated image specified in the &lt;code&gt;imageURL&lt;/code&gt; field:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--av_5ESGd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1erkqxip5f0dtlkob1n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--av_5ESGd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1erkqxip5f0dtlkob1n.png" alt="Image generation API" width="650" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This approach is the most cost-effective, considering it is relying on monthly subscriptions. It also may save weeks or months of implementation time, therefore speeding up the go-to-market process for new product features.&lt;/p&gt;

&lt;p&gt;At the same time, you depend and rely on the image generation API, so you need to spend time on research and evaluation of the vendor and your future partner. You need to check the SLAs provided, the server location, capacity, bandwidth limitations, as well as data privacy aspects and implementation of the GDPR regulation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option #2: Image Generation Library
&lt;/h2&gt;

&lt;p&gt;The next option is to use an image generation library and implement the full solution yourself. Libraries like &lt;a href="https://github.com/ImageMagick/ImageMagick"&gt;ImageMagick&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/Python_Imaging_Library"&gt;Python Imaging Library&lt;/a&gt; (PIL), and &lt;a href="https://sharp.pixelplumbing.com/"&gt;Sharp in Node.js&lt;/a&gt; provide an API for image processing. Such libraries are typically used for resizing, cropping, changing image format, compressing images, etc.&lt;/p&gt;

&lt;p&gt;However, these libraries have evolved in recent years and now offer image composition as well. With image composition, it’s possible to combine two or more individual images to create a single image.&lt;/p&gt;

&lt;p&gt;Here is the image composition example using &lt;a href="https://sharp.pixelplumbing.com/"&gt;Sharp library&lt;/a&gt; based on Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await sharp('input.gif')
  .composite([
    { input: ”logo.png”, gravity: 'northwest' },
    { input: “button.jpg”, gravity: 'southeast' },
  ])
  .toFile('combined.png');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we take the input.gif as a background image and put logo.png at the upper left corner using gravity set to ‘northwest’ and the button.jpg at the bottom right corner specified by gravity ‘southeast’ accordingly. We save the result into a combined.png file that will contain the combination of these three images.&lt;/p&gt;

&lt;p&gt;If you need precise positioning of the image overlays, you can use images[].top and images[].left properties instead of gravity to provide pixel offsets from the top and the left of the background image. You can check the &lt;a href="https://sharp.pixelplumbing.com/api-composite"&gt;API documentation&lt;/a&gt; for more information.&lt;/p&gt;

&lt;p&gt;Using a library for image generation makes sense when your use case is very simple and you don’t have to build complex designs or creatives with multiple images and text overlays inside. However, the implementation may be tedious to do pixel-perfect positioning of the overlays in the code and also difficult to maintain in the future.&lt;/p&gt;

&lt;p&gt;Another limitation is the possibility of design customization and brand-specific styling. You may quickly hit the limit of what’s possible, for example, when you need to implement shadows, custom gradients, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option #3: Generate Images Using a Browser and Puppeteer Screenshots
&lt;/h2&gt;

&lt;p&gt;Another possible option is to build your design by adding texts and overlapping images directly using HTML. You can open this HTML page in the browser programmatically using a library like &lt;a href="https://github.com/puppeteer/puppeteer"&gt;Puppeteer&lt;/a&gt; and then generate a final image by taking a screenshot of the opened page.&lt;/p&gt;

&lt;p&gt;Here is a quick code sample for that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const puppeteer = require('puppeteer');
(async () =&amp;gt; {
  const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
  const page = await browser.newPage();
  await page.goto('https://dynapictures.com');
  await page.screenshot({path: 'dynapictures.png'});
  await browser.close();
})();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach gives more freedom and flexibility compared to the first option, as it becomes much easier to create and maintain image templates. It’s also more resource-intensive as you need to host and run a cluster of browser instances on the server.&lt;/p&gt;

&lt;p&gt;You also have to care for maintenance, updates, emojis functioning, and make sure that your setup is secure. It is crucial to also ensure that no one can download sensitive information from the server filesystem by tricking a browser to open some file on the server and then render it as an image.&lt;/p&gt;

&lt;p&gt;Additionally, you have to hire a system administrator and make sure that your service stays up and running when the hard drive gets full at any given moment.&lt;/p&gt;

&lt;p&gt;This option requires significant server resources as well as browser instances may take lots of RAM and computing power.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/web/tools/puppeteer/get-started"&gt;Start here&lt;/a&gt; if you decide to go down this path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;All that to say, image generation is a new area that has grown rapidly in the last few years. Choosing a reliable vendor for &lt;a href="https://dynapictures.com/"&gt;image generation&lt;/a&gt; may save weeks or even months of implementation time, it is cost-effective and also helps speed up the go-to-market process for the new product features.&lt;/p&gt;

&lt;p&gt;Did you have any experience with dynamic image generation in the past? Should we cover any specific details in the next articles? Tell us in the comments below!&lt;/p&gt;

&lt;p&gt;Originally published on &lt;a href="https://dzone.com/articles/image-generation-code-library-api-sample-example"&gt;DZone&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>productivity</category>
      <category>api</category>
      <category>imagegeneration</category>
    </item>
  </channel>
</rss>
