Skip to main content

Usage

The pipeline runs as four separate, manually-invoked scripts — there's no single orchestrating command.

1. Extract a palette and build a theme file

Get-ChildItem "D:\CTS\AptlantisLogos\png\*.png" | % {
$n = $_.BaseName
magick "$($_.FullName)" -resize 200x200 -colors 16 -unique-colors txt: | Out-File "D:\CTS\AptlantisLogos\palettes\$n-palette.txt"
}

Get-ChildItem "D:\CTS\AptlantisLogos\palettes\*-palette.txt" | % {
$n = $_.BaseName -replace '-palette',''
$hex = (Select-String '#[0-9A-F]{6}' $_ | % { $_.Matches.Value })
"@`n[meta]`nname = `"$n`"`nvariant = `"auto-generated`"`n`n[palette]`nprimary = `"$($hex[0])`"`nsecondary = `"$($hex[1])`"`nsurface = `"$($hex[2])`"`naccent = `"$($hex[3])`"`ntext = `"$($hex[-1])`"`n" | Out-File "D:\CTS\AptlantisLogos\themes\$n.toml"
}

2. Convert to SVG and ICO

python "D:\CTS\AptlantisLogos\scripts\Convert-to-SVG.py" --input "D:\CTS\AptlantisLogos\png" --mode embed --output-dir "D:\CTS\AptlantisLogos\svg"

python "D:\CTS\AptlantisLogos\scripts\Convert-to-ICO.py" --input "D:\CTS\AptlantisLogos\png" --sizes 48 --output "D:\CTS\AptlantisLogos\ico"

Convert-to-SVG.py supports two real modes: embed (wraps the raster as base64 inside an SVG container — what this repo actually uses) and trace (vectorizes a monochrome bitmap into polygon contours via OpenCV, with --threshold and --simplify controls). auto mode picks trace if OpenCV is present, otherwise falls back to embed.

3. Regenerate the atlas

python "D:\CTS\AptlantisLogos\scripts\generate_atlas.py"

Produces palette-atlas.html — a single self-contained (and large — the embedded images make it well over 100MB) HTML page for visually reviewing every logo alongside its extracted palette.

Command reference

Convert-to-SVG.py [-h] --input INPUT [--output-dir OUTPUT_DIR] [--mode {auto,embed,trace}]
[--threshold THRESHOLD] [--simplify SIMPLIFY] [--invert] [--overwrite]

Convert-to-ICO.py [-h] --input INPUT [--output OUTPUT] [--recursive] [--sizes SIZES]