Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousDynamic SVG Avatars
NextRelational Filtering
Media & Binary Assets

Image Thumbnails & CDN Transformations

On-demand dynamic landscape vector thumbnails and Cloudinary CDN image transformation pipelines. Features intelligent multi-line word wrapping, dimension badge indicators, custom subtitle labels, and responsive <picture> element support.

Vector Landscape SVG ThumbnailsSmart Multiline Word-WrappingDimension Overlay BadgesCloudinary On-The-Fly CDN Transforms

Landscape Thumbnail Studio

Live interactive playground with instant SVG rendering, aspect ratio presets, and text word wrapping.

GET /api/v1/thumbnails/:seed.svg
Common Aspect Ratio Presets:
Mastering Modern React Hooks
Width:600px
Height:400px
https://playground.nileslabs.com/api/v1/thumbnails/react-hooks-tutorial.svg?text=Mastering+Modern+React+Hooks&description=A+comprehensive+guide+to+stateful+patterns+%26+custom+reusable+hooks

Thumbnail API Query Parameters

All supported modifiers for GET /api/v1/thumbnails/:seed[.svg]:

ParameterTypeDefaultAllowed RangeDescription
:seedStringRequiredAny valid stringURL path parameter used for deterministic color palette hashing and default title generation.
width / wInteger600100 to 1920 pxCanvas width. Scales font sizes and safe character margins automatically.
height / hInteger400100 to 1080 pxCanvas height. Center-aligns title, subtitle, and dimension badge vertically.
textStringFormatted seedUp to 3 wrapped linesCustom primary title text. Automatically word-wraps with ellipsis overflow protection.
description / desc / subtitleStringnullUp to 3 wrapped linesOptional secondary text rendered with 88% opacity beneath the primary title.

Responsive SVG Canvas Architecture & Word Wrapping

How the backend balances typography, padding, and subtle grid textures across arbitrary canvas aspect ratios.

1

Dynamic Font Sizing

Font size adapts dynamically based on canvas dimensions: Math.min(width * 0.052, height * 0.12, 48), ensuring text never overpowers smaller card previews.

2

Smart Safe-Zone Wrapping

Titles wrap cleanly within 84% width margin (wrapText). Long titles automatically truncate at line 3 with trailing ellipses (...).

3

Texture Grid & Pill Badge

Each thumbnail embeds a 40×40px subtle geometric grid overlay (rgba(255,255,255,0.07)) and an auto-centered pill badge showing exact canvas resolution.

Cloudinary On-The-Fly Transformations for Uploaded Assets

Files uploaded to POST /api/v1/uploads leverage Cloudinary CDN URL manipulation for real-time resizing and format conversion.

Transform URL Conventions

Append dimension and crop tokens directly between /upload/ and the asset folder path:

# Original URL:

.../image/upload/v1/uploads/products/shoe.jpg

# Transformed 400x300 WebP Thumbnail:

.../image/upload/w_400,h_300,c_fill,q_auto,f_auto/v1/uploads/products/shoe.jpg

Supported Transformation Flags

TokenMeaningExample
w_...Width in pixelsw_600
h_...Height in pixelsh_400
c_fillCrop & fill canvasc_fill,g_auto
f_autoAuto format (WebP / AVIF)f_auto
q_autoIntelligent compressionq_auto

Interactive Thumbnail API Consoles

Test direct HTTP endpoints with custom dimensions and text parameters:

Fetch Default 600×400 Thumbnail

Fetches raw SVG image data with Post #1 formatted title.

GET
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Fetch 16:9 Banner with Title & Description

Generates an 800×450 thumbnail with multiline title and secondary subtitle.

GET
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Production Client Integration Recipes

Ready-to-use snippets for Next.js Image, responsive HTML <picture>, and Cloudinary transformation helpers:

1
// Next.js 14/15 Responsive Image with Custom Thumbnail Loader
2
import Image from 'next/image';
3
4
interface BlogPostCardProps {
5
slug: string;
6
title: string;
7
summary: string;
8
}
9
10
export function BlogPostThumbnail({ slug, title, summary }: BlogPostCardProps) {
11
// Construct dynamic thumbnail URL with auto word-wrapping & dimension badge
12
const thumbnailUrl = https://playground.nileslabs.com/api/v1/thumbnails/${encodeURIComponent(
13
slug
14
)}.svg?width=800&height=450&text=${encodeURIComponent(
15
title
16
)}&description=${encodeURIComponent(summary)};
17
18
return (
19
<div className="relative w-full aspect-video rounded-2xl overflow-hidden shadow-xs border border-slate-200">
20
<Image
21
src={thumbnailUrl}
22
alt={title}
23
fill
24
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
25
className="object-cover hover:scale-105 transition-transform duration-300"
26
priority={false}
27
/>
28
</div>
29
);
30
}
Previous in Media

Deterministic SVG Avatars

Explore 12 curated gradients and initials parsing for user profile avatars.

Related

Multipart File Uploads

Upload images, PDFs, and documents with binary magic bytes validation.