Post-process original logos into standardised 256x256 PNG format
This skill transforms original logo images into standardised 256x256 PNG format suitable for vault protocol metadata. It automatically selects the most square variant from available logos and applies padding if needed to create a perfect square output.
Before starting, gather the following from the user:
eth_defi/data/vaults/original_logos/protocol-name/)eth_defi/data/vaults/formatted_logos/)generic, light, dark, or allIf any required input is missing, ask the user before proceeding.
Ensure the following are available:
poetry install --with devPython Pillow is installed for detecting image format, dimensions, and transparency.
There is no universal standard how artist name their logo files for dark and light variants. In our case, we always say
light: light (white) text on dark or transparent backgrounddark: dark (black) text on white or transparent backgroundFollowing vocabulary is used:
List all image files in the input folder and classify them:
{slug}.generic.{ext} - Generic/default theme{slug}.light.{ext} - Light background theme (dark logo){slug}.dark.{ext} - Dark background theme (light logo)Process the selected logo variant. The script will automatically add padding to non-square logos to make them square before scaling.
export INPUT_IMAGE=/path/to/original/logo.png
export OUTPUT_IMAGE=/path/to/output/logo.generic.png
poetry run python scripts/logos/post-process-logo.py
The script will:
Provide the user with:
Output files should follow this naming pattern:
{protocol-slug}/light.png - For light backgrounds{protocol-slug}/dark.png - For dark backgroundsIf SVG conversion fails:
If the background isn't removed properly: