Skip to content

vimeejs/opengraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opengraph

Procedural OGP image generator for vimee.

screenshot

How it works

Generates a 1200x630 OGP image with:

  • Procedural background — Color blobs + gaussian blur create a unique gradient-mesh per input text
  • Deterministic — Same text always produces the same image (FNV-1a hash → seed)
  • SVG iconvimee.svg is rasterized at runtime via oksvg
  • Film grain — Multiplicative noise preserves hue
  • 2x supersampling — Renders at 2400x1260, downscales to 1200x630 with bilinear filtering

Requirements

  • Go 1.22+

Usage

# Build
make build

# Generate with defaults
make generate

# Generate with custom text
make generate TITLE="My Project" SUBTITLE="A cool description"

# Or run directly
go run . "title" "subtitle"
go run . "title"  # subtitle is optional

# Clean up
make clean

Output

og.png (1200x630 PNG) in the current directory.

Customization

Edit constants in main.go:

Constant Description
titleSize / subtitleSize Font sizes (at 2x resolution)
blurR Gaussian blur radius for background
numBlobs Number of color blobs
grainDensity Fraction of pixels affected by grain (0.0-1.0)
grainStrength Max noise percentage (+/-)
palette Color palette for background blobs

Changing the font

Replace the embedded font file and update the //go:embed directive:

//go:embed fonts/YourFont.ttf
var fontData []byte

Changing the icon

Replace vimee.svg in the project root. The SVG is rasterized at runtime — no pre-conversion needed.

Dependencies

About

Procedural OGP image generator for vimee

Topics

Resources

License

Stars

Watchers

Forks

Contributors