CNCF Icon WebP

Overview

Generate a webp cover image from a CNCF project icon by flattening transparency onto a white background, scaling to match the reference logo area, and centering on a canvas sized to a reference image.

Workflow

1) Collect inputs: icon URL or local file, reference image path, output path. 2) Run the script to build a centered webp with matching size. 3) Verify output size and alpha channel.

Script: scripts/generate_cncf_icon_webp.py

Requirements:

Example:

1
2
3
4
python3 scripts/generate_cncf_icon_webp.py \
  --icon-url https://raw.githubusercontent.com/cncf/artwork/main/projects/istio/icon/color/istio-icon-color.png \
  --reference assets/img/kubernetes/kubernetes.webp \
  --output assets/img/kubernetes/istio/istio.webp

Common options:

Verification

Optional checks:

1
2
sips -g pixelWidth -g pixelHeight assets/img/kubernetes/istio/istio.webp
webpinfo -summary assets/img/kubernetes/istio/istio.webp

Notes