A deterministic image-composition toolkit for building editable photocard layouts from prepared subjects, versioned template manifests, and layered artwork.
The renderer separates subject preparation, crop geometry, template intent, layer order, visual treatment, and final export. This makes layouts repeatable and keeps exact frames, typography, and positioning under application control.
This repository contains reusable rendering techniques extracted from Photocard.ai.
- Normalizes source images
- Represents templates as versioned composition manifests
- Supports crop plans and normalized frames
- Separates alpha masks from foreground RGB data
- Refines hair and semi-transparent subject edges
- Composes background, behind-subject, subject, and foreground layers
- Applies reusable subject treatment contracts
- Produces deterministic preview and export images
- Provides a provider-neutral interface for optional generated backgrounds
background → behind-subject artwork → prepared subject
→ subject treatment → foreground artwork → export processing
npm install
npm run checkThe public API is exported from src/index.ts. See examples/ for a complete
synthetic composition plan.
- Production API keys or private provider configuration
- Private storage, database, billing, entitlement, or moderation services
- User accounts or customer uploads
- Proprietary template artwork, fonts, or reference images
- A guaranteed identity-preserving image-generation service
- Architecture
- Template manifest
- Subject preparation
- Edge decontamination
- Layered composition
- Provider contract
- Limitations
- Source-backed technical note
Explore the interactive workflow in Photocard.ai's K-pop photocard maker.
The techniques in this repository are extracted from the image-composition workflow used by Photocard.ai.
Original source code is available under the MIT License. Example images in this repository are synthetic. Third-party fonts, artwork, templates, and generated references require separate attribution and redistribution review.