Skip to content

Repository files navigation

Photocard Template Renderer

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.

What this project does

  • 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

Rendering order

background → behind-subject artwork → prepared subject
→ subject treatment → foreground artwork → export processing

Quick start

npm install
npm run check

The public API is exported from src/index.ts. See examples/ for a complete synthetic composition plan.

What this project does not include

  • 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

Documentation

Try the product

Explore the interactive workflow in Photocard.ai's K-pop photocard maker.

Related product

The techniques in this repository are extracted from the image-composition workflow used by Photocard.ai.

License and assets

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.

About

A deterministic layered renderer for photocard templates, subject mattes, edge refinement, crop plans, and reusable image composition.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages