Skip to content

Architecture Case Study

PracharFlow

Low-latency localized rendering engine serving automated bots. Replaced unpredictable image models with a deterministic parametric canvas engine built in Java 21 and Spring Boot 3 using Skia (Skija). Achieved <150 ms layout compilation for complex Devanagari and Gujarati scripts with zero GPU overhead.

Java 21Spring Boot 3Skija / SkiaPostgreSQLRedisLive Deployment ↗

1. The Situation

Campaigns and businesses require hundreds of localized banner creatives daily with accurate regional typography, official emblems, and portraits delivered instantly via messaging bots.

2. The Constraint & Tension

Generative diffusion models hallucinate Devanagari and Gujarati ligatures, distort official brand and political party logos, and take 8+ seconds per generation. Campaigns required guaranteed typography accuracy and sub-second generation.

3. The Architecture Decision

Rejected generative image pipelines in favor of a deterministic parametric canvas engine. Built in Java 21 / Spring Boot 3 using Google's Skia (via Skija), rendering structured layout trees with typed slot constraints directly to PNG buffers.

Consequence & Verified Outcome

Pixel-perfect regional typography and exact logo rendering in under 150ms with zero GPU infrastructure costs, serving automated Telegram bot workflows.

4. System Architecture

PracharFlow Rendering PipelineVector Core
Parametric Layout JSONTyped text & logo slotsStrict constraint rulesSkia / Skija EngineJava 21 · Spring Boot 3Devanagari Font RenderingRender time: <150msTelegram / WhatsAppAutomated daily delivery100% Deterministic Output
Hover stages to trace pipeline execution

5. Verbatim Code Evidence

Artifact Excerptpracharflow/render/.../CompositorService.java:214-216
try (Surface surface = Surface.makeRaster(ImageInfo.makeN32Premul(width, height))) {
    // NON-OWNING. Owned by `surface`. Never closed, never in try-with-resources.
    Canvas canvas = surface.getCanvas();

6. Trade-offs & What's Left

Authoring templates takes structured JSON design work upfront rather than freeform text prompts. Every layout variant must be coded with explicit font metric fallbacks.

Active Roadmap

  • WhatsApp Business Cloud API webhook automation
  • Self-service web template designer with drag-and-drop constraints