Stop Resizing 200 Banners by Hand: Practical Design Automation and Scripts for Creative Teams

Stop Resizing 200 Banners by Hand: Practical Design Automation and Scripts for Creative Teams

The Creative Burnout Engine: Manual Design Grunt Work

Ask any junior or mid-level graphic designer about their least favorite day of the month, and they will describe the same soul-crushing ritual: marketing just finalized twenty new editorial articles, and they need five promotional banner sizes for each article across LinkedIn, Instagram Stories, Twitter/X, and the company newsletter. Furthermore, the brand operates across Portugal and international markets, requiring every single asset in both European Portuguese and English.

That represents two hundred distinct banners.

The designer opens Figma, duplicates an artboard two hundred times, and spends the next six hours copy-pasting article titles, swapping author headshots, re-centering author names, and verifying that Portuguese accents like ã, ç, and é did not shift the baseline typography. By hour four, mental fatigue sets in. Inevitably, someone’s name is misspelled, a drop shadow is forgotten on three cards, and an outdated logo variant slips into production.

This is the creative burnout engine. Designers did not study color theory, visual hierarchy, and brand narrative at art school to spend forty hours a month acting as biological copy-paste algorithms.

At Webxtek, we believe creative talent should be spent on strategic decisions—crafting unforgettable brand identities, refining typographic harmony, and conceptualizing emotional user experiences. Everything that is repetitive, deterministic, and rule-based should be automated.

Through programmatic Digital Design workflows and robust Brand Guidelines, our team builds automated generation pipelines using lightweight Node.js scripts, vector SVG templates, and the Sharp image processing library. Tasks that previously drained two full workdays now run in six seconds.


The Architecture of Programmatic Visual Generation

To automate design production without sacrificing visual sophistication, you must separate Visual Structure from Dynamic Content.

When designing manually, your layout, typography, colors, and specific copy are permanently welded together inside a graphical canvas. In programmatic design, the layout is treated as a parameterized template, while the content resides in clean structured data.

PROGRAMMATIC BATCH ASSET GENERATION PIPELINE

  • Content Data Source (JSON): Article Title
  • Parameterized SVG Template: Semantic Typography
  • Author Avatar & Name — + — • Brand Gradient Mesh
  • Category & Date Badge: Language Locale (EN/PT)
  • Dynamic Text Wrap Boxes: High-Contrast Backdrop
  • Template Compiler Engine (Variable String Inject)
  • Sharp Image Compositor
  • SVG Vector Rasterizer
  • Layer Alpha Blend
  • High-DPI Output (AVIF)
  • LinkedIn Feed Banner: [Instagram Story Card] [Open Graph Header] (1200x628 - Baseline) (1080x1920 - 9:16) (1200x630 - Retina)

How the Pipeline Works

  1. The Parameterized SVG Blueprint: You design the master graphic once inside Figma or Illustrator, ensuring all layers, grids, and visual balance are perfected. You then export the layout as an SVG and replace static text strings with dynamic template interpolation variables (such as {{TITLE}}, {{AUTHOR}}, and {{BADGE_COLOR}}).
  2. The Structured Data Source: Your marketing team maintains an editorial calendar, spreadsheet, or headless CMS JSON feed containing the localized titles, author credentials, and category tags.
  3. The Node.js and Sharp Compositor: A concise Node.js script reads the data feed, populates the SVG variables, and sends the raw vector buffer directly into Sharp. Sharp renders the vector into high-resolution pixels, composites the author’s photograph into a pre-masked circular avatar slot, and outputs optimized AVIF, WebP, and Baseline JPEG files at machine speed.

Because the vector blueprint is parsed in native C++ memory without opening a graphical user interface, you can generate 500 retina-grade banners in less than ten seconds.


Building a Reusable Programmatic SVG Template

Modern web standards governed by the MDN Web Docs provide full vector composition capabilities inside SVG markup, including radial gradients, drop filters, clipping paths, and flex-like foreign objects.

Here is an example of an SVG template designed for high-impact social preview cards:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630" width="1200" height="630">
  <defs>
    <!-- Dark Studio Brand Gradient -->
    <linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" stop-color="#0F172A"/>
      <stop offset="100%" stop-color="#020617"/>
    </linearGradient>

    <!-- Subtle Accent Glow -->
    <radialGradient id="accentGlow" cx="90%" cy="10%" r="60%">
      <stop offset="0%" stop-color="{{ACCENT_COLOR}}" stop-opacity="0.25"/>
      <stop offset="100%" stop-color="#020617" stop-opacity="0"/>
    </radialGradient>

    <!-- Circular Avatar Mask -->
    <clipPath id="avatarClip">
      <circle cx="110" cy="520" r="42"/>
    </clipPath>
  </defs>

  <!-- Background Base -->
  <rect width="1200" height="630" fill="url(#bgGrad)"/>
  <rect width="1200" height="630" fill="url(#accentGlow)"/>

  <!-- Brand Watermark Symbol -->
  <path d="M1100 80 L1140 120 L1100 160 L1060 120 Z" fill="{{ACCENT_COLOR}}" opacity="0.4"/>

  <!-- Category & Locale Pill -->
  <rect x="70" y="65" width="160" height="36" rx="18" fill="{{ACCENT_COLOR}}" fill-opacity="0.15"/>
  <text x="150" y="88" font-family="Plus Jakarta Sans, sans-serif" font-size="14" font-weight="700" fill="{{ACCENT_COLOR}}" text-anchor="middle" letter-spacing="1.5">
    {{CATEGORY}}
  </text>

  <!-- Dynamic Multi-line Title -->
  <text x="70" y="190" font-family="Plus Jakarta Sans, sans-serif" font-size="52" font-weight="800" fill="#F8FAFC" letter-spacing="-1">
    <tspan x="70" dy="0">{{TITLE_LINE_1}}</tspan>
    <tspan x="70" dy="68">{{TITLE_LINE_2}}</tspan>
    <tspan x="70" dy="68">{{TITLE_LINE_3}}</tspan>
  </text>

  <!-- Author Avatar Image (Composited via Sharp) -->
  <image href="{{AVATAR_URI}}" x="68" y="478" width="84" height="84" clip-path="url(#avatarClip)"/>

  <!-- Author Metadata -->
  <text x="175" y="515" font-family="Plus Jakarta Sans, sans-serif" font-size="20" font-weight="700" fill="#FFFFFF">
    {{AUTHOR_NAME}}
  </text>
  <text x="175" y="542" font-family="Plus Jakarta Sans, sans-serif" font-size="15" font-weight="500" fill="#94A3B8">
    {{AUTHOR_ROLE}} • {{READ_TIME}}
  </text>
</svg>

When you examine this template, notice the precision of the coordinate layout:

  • The font family references your production typeface (Plus Jakarta Sans), which is loaded locally by the renderer.
  • The {{TITLE_LINE_X}} variables receive pre-wrapped text lines calculated programmatically by a simple hyphenation or string-splitting algorithm.
  • Colors are injected using semantic variables, allowing the exact same template to swap into light mode or multi-brand palettes instantaneously.

The Node.js Automation Script: From JSON to 200 Assets

Below is the complete, runnable Node.js batch script. It demonstrates how to read an array of editorial records, inject dynamic strings into the SVG blueprint, composite author avatars using Sharp, and write production-ready JPEG files to an output directory.

import fs from 'node:fs/promises';
import path from 'node:path';
import sharp from 'sharp';

// Helper function to split long titles into clean lines
function wrapTitle(text, maxCharsPerLine = 32) {
  const words = text.split(' ');
  const lines = ['', '', ''];
  let currentLine = 0;

  for (const word of words) {
    if ((lines[currentLine] + ' ' + word).trim().length <= maxCharsPerLine) {
      lines[currentLine] = (lines[currentLine] + ' ' + word).trim();
    } else if (currentLine < 2) {
      currentLine++;
      lines[currentLine] = word;
    } else {
      lines[currentLine] += '...';
      break;
    }
  }
  return lines;
}

async function generateBatchBanners() {
  const templateRaw = await fs.readFile('./templates/social-card.svg', 'utf-8');
  const articlesData = JSON.parse(await fs.readFile('./data/articles.json', 'utf-8'));

  console.log(`Starting generation for ${articlesData.length} localized assets...`);
  const startTime = Date.now();

  for (const item of articlesData) {
    const [line1, line2, line3] = wrapTitle(item.title);

    // 1. Interpolate variables into the SVG string
    let svgContent = templateRaw
      .replace('{{CATEGORY}}', item.category.toUpperCase())
      .replace('{{ACCENT_COLOR}}', item.brandColor || '#38BDF8')
      .replace('{{TITLE_LINE_1}}', line1)
      .replace('{{TITLE_LINE_2}}', line2)
      .replace('{{TITLE_LINE_3}}', line3)
      .replace('{{AVATAR_URI}}', item.avatarLocalPath)
      .replace('{{AUTHOR_NAME}}', item.author)
      .replace('{{AUTHOR_ROLE}}', item.role)
      .replace('{{READ_TIME}}', `${item.readTimeMinutes} min read`);

    // 2. Render and save using Sharp
    const outputPath = path.join('./dist', `${item.slug}-${item.lang}.jpg`);
    
    await sharp(Buffer.from(svgContent))
      .jpeg({ quality: 88, progressive: false })
      .toFile(outputPath);

    console.log(`✓ Generated: ${outputPath}`);
  }

  const duration = ((Date.now() - startTime) / 1000).toFixed(2);
  console.log(`🎉 Finished batch generation in ${duration} seconds.`);
}

generateBatchBanners().catch(console.error);

Performance Benchmark: Manual vs. Automated Production

To understand why this approach represents an undeniable competitive advantage for creative agencies and in-house studios, look at the operational comparison:

Production Parameter Traditional Manual Workflow Programmatic Node.js & Sharp Pipeline
Time per 200 Banners 6 to 8 hours of tedious clicking 3.8 seconds
Typographical Typo Rate 3% to 6% (human fatigue) 0.0% (direct database sync)
Bilingual Localization Double manual effort Handled instantly via JSON locale switch
Brand Identity Updates Full manual redraw across all files Update one SVG blueprint and rerun script
Asset Export Cost €250–€400 in agency billing hours Negligible computing power

Bridging Figma to Automation: The Plugin API & Token Webhooks

The power of programmatic design does not mean leaving your favorite design tool behind. In fact, the most effective creative teams use Figma as the single source of truth for variables, while using scripts to extract those decisions directly into production code.

Using the Figma Plugin API, you can write a lightweight script that scans all Variables in your project and exports them into standard token schemas:

FIGMA VARIABLE TO REPO AUTOMATION FLOW

  • Figma Design File (Tokens & Variables)
  • Color Modes: Light, Dark, High-Cont
  • Typography: Fluid Rem Scales
  • Spacing: 4px Base Scale Units
  • Custom Figma Plugin (Typescript)
  • Scans figma.variables.get...()
  • Formats into W3C DTCG JSON Schema
  • (HTTP POST Webhook)
  • GitHub Actions / Edge Server Pipeline
  • Validates Schema Integrity
  • Triggers Re-render of Social Assets
  • Commits Updated Tokens into Codebase

Sample Figma Plugin Code Snippet

Here is how a Figma plugin extracts design tokens directly from your active variable collections:

// Figma Plugin Environment (code.ts)
async function exportTokensToJSON() {
  const collections = await figma.variables.getLocalVariableCollectionsAsync();
  const tokenGraph: Record<string, any> = {};

  for (const col of collections) {
    tokenGraph[col.name] = {};
    for (const varId of col.variableIds) {
      const variable = await figma.variables.getVariableByIdAsync(varId);
      if (!variable) continue;

      // Extract values across all configured modes (e.g., Light, Dark)
      tokenGraph[col.name][variable.name] = {
        $type: variable.resolvedType.toLowerCase(),
        $description: variable.description,
        valuesByMode: variable.valuesByMode
      };
    }
  }

  // Send the extracted token graph to your backend or automation script
  figma.ui.postMessage({ type: 'EXPORT_SUCCESS', payload: tokenGraph });
}

By connecting your Figma variables to an automated generation pipeline, design updates become continuous and effortless. When your creative director refines a brand color from royal blue to deep indigo, that decision propagates automatically into your social card generator, your design token stylesheets, and your production applications—freeing your creative team to focus on the visionary work they do best.

In practice, we apply these exact architectural standards across specialized sectors including advertising & creative agencies and cbd & wellness brands. Whether you are modernizing core workflows through digital design that stops the scroll and UX/UI Design, connecting sector-specific requirements to disciplined execution is what turns technical theory into compounding commercial advantage.

[+] [ INDEX_DIRECTORY ] 16 topics ▼
[ SYSTEM.FAQ ]

Frequently Asked Questions

What is programmatic asset generation in a modern creative workflow?

Programmatic asset generation replaces manual manual artboard duplication with automated scripts. By pairing dynamic vector SVG templates with structured data sources (like JSON feeds or headless CMS APIs), an automated engine compiles hundreds of branded social graphics, localized banners, or merchandise mockups in seconds.

Why should teams use SVG templates rather than headless browser screenshots for batch images?

Headless browser instances (such as Puppeteer) require substantial memory, launch full Chromium binaries, and often suffer from sporadic font-rendering delays. Native SVG template rendering via Sharp parses text and vectors directly in C++ memory, running up to twenty times faster with deterministic typography.

How can the Figma Plugin API be used to eliminate manual token exports?

The Figma Plugin API exposes the entire document tree, variable collections, and mode definitions. A lightweight custom plugin can iterate over all color and typography variables, transform them into W3C Design Token Community Group (DTCG) JSON schemas, and automatically dispatch a webhook to synchronize your code repository.

How does batch image automation ensure strict brand consistency across languages?

When a script controls typography constraints, text bounding boxes, line wrapping algorithms, and color variable lookups, human error is completely eliminated. Translating a marketing campaign into Portuguese, German, and Spanish will never result in misaligned badges or broken font weights.

> START_PROJECT

Need a website that earns trust, ranks in search, and gives your business a stronger digital presence? Start the conversation here.