DEV Community

Cover image for I Replaced Photoshop With a Single API Call — Here's How
Fidel de Jesus
Fidel de Jesus

Posted on

I Replaced Photoshop With a Single API Call — Here's How

Your images shouldn't take 30 seconds to generate.

I was building a SaaS app and needed to generate branded images dynamically — social posts, certificates, promo banners, event tickets. The obvious approach was to use a design tool or image library.

But every solution I tried was either:

  • Too slow (rendering took seconds)
  • Too complex (SDK, auth tokens, config files)
  • Too ugly (templated outputs that look like 2015)

So I built SnapAssets — an API that generates production-ready images in 12 milliseconds.

The Idea

One endpoint. Send JSON. Get a PNG back. No auth. No SDK. No setup.

curl -X POST https://assets.qbacode.com/api/v1/generate-asset \
  -H "Content-Type: application/json" \
  -d '{
    "template": "promotional",
    "productName": "Pro Plan",
    "discount": "50% OFF",
    "originalPrice": "$99",
    "salePrice": "$49"
  }' \
  --output promo.png
Enter fullscreen mode Exit fullscreen mode

That's it. You get a 1200x630 PNG in ~12ms.

What Templates Are Available

Right now there are 5 templates, each designed for a specific use case:

1. Basic

OG images, social cards, blog headers. Clean, professional, branded.

curl -X POST https://assets.qbacode.com/api/v1/generate-asset \
  -H "Content-Type: application/json" \
  -d '{
    "template": "basic",
    "title": "How to Build Modern Web Applications",
    "description": "A comprehensive guide to fast, scalable apps.",
    "siteName": "blog.example.com",
    "primaryColor": "#0F172A",
    "accentColor": "#06B6D4"
  }'
Enter fullscreen mode Exit fullscreen mode

2. Promotional

Flash sales, discount banners, product highlights. Strikethrough prices, sale badges, CTAs.

curl -X POST https://assets.qbacode.com/api/v1/generate-asset \
  -H "Content-Type: application/json" \
  -d '{
    "template": "promotional",
    "productName": "Premium Wireless Headphones",
    "discount": "50% OFF",
    "originalPrice": "$199.99",
    "salePrice": "$99.99",
    "primaryColor": "#ff3366",
    "accentColor": "#ffd23f"
  }'
Enter fullscreen mode Exit fullscreen mode

3. Certificate

Awards, course completions, achievements. Gold seals, recipient names, instructor signatures.

curl -X POST https://assets.qbacode.com/api/v1/generate-asset \
  -H "Content-Type: application/json" \
  -d '{
    "template": "certificate",
    "recipientName": "John Smith",
    "courseName": "Advanced Web Development",
    "description": "For successfully completing the course with distinction",
    "completionDate": "March 7, 2026",
    "instructorName": "Dr. Jane Anderson",
    "primaryColor": "#0F172A",
    "accentColor": "#D4AF37"
  }'
Enter fullscreen mode Exit fullscreen mode

4. Event

Tickets, conference passes, meetup invites. QR codes, attendee info, venue details.

curl -X POST https://assets.qbacode.com/api/v1/generate-asset \
  -H "Content-Type: application/json" \
  -d '{
    "template": "event",
    "eventName": "Tech Summit 2026",
    "eventDate": "March 15, 2026",
    "eventTime": "9:00 AM - 6:00 PM",
    "venue": "Convention Center - San Francisco",
    "attendeeName": "Alex Johnson",
    "ticketType": "VIP Access",
    "primaryColor": "#7c3aed",
    "accentColor": "#06b6d4"
  }'
Enter fullscreen mode Exit fullscreen mode

5. Summering

Blog headers, news cards, article summaries. Image + title + description in a clean card.

curl -X POST https://assets.qbacode.com/api/v1/generate-asset \
  -H "Content-Type: application/json" \
  -d '{
    "template": "summering",
    "title": "Breaking News: Major Event",
    "description": "A brief summary of the news article.",
    "imageUrl": "https://example.com/image.jpg",
    "primaryColor": "#1982c4",
    "secondaryColor": "#6a4c93",
    "textColor": "#ffffff"
  }'
Enter fullscreen mode Exit fullscreen mode

Why This Matters

For developers:

  • No more fighting with image libraries
  • No more "the designer is busy" bottleneck
  • Generate thousands of unique images programmatically
  • 12ms response time — faster than your database query

For products:

  • Dynamic OG images per user/content
  • Auto-generated social cards for blog posts
  • Personalized certificates at scale
  • Event tickets with unique attendee info

The Tech Stack

  • Edge runtime — cold starts don't exist
  • React Server Components — template rendering
  • Google Fonts — loaded per request for proper typography
  • No database — stateless, infinitely scalable

Try It Right Now

No signup. No API key. Just run this:

curl -o test.png "https://assets.qbacode.com/api/v1/generate-asset?template=basic&title=Hello+World&siteName=test.com"
Enter fullscreen mode Exit fullscreen mode

Open test.png. That's your image.

What's Next

  • More templates (og:image, twitter cards, youtube thumbnails)
  • Custom template builder
  • Webhook support for async generation
  • SVG export

Live API: assets.qbacode.com
Video Demo: YouTube

If this saves you time.

Top comments (0)