diff --git a/Scripts/check-brand-icon-lowres.sh b/Scripts/check-brand-icon-lowres.sh new file mode 100755 index 0000000..a499f0c --- /dev/null +++ b/Scripts/check-brand-icon-lowres.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$repo_root" + +ictool="/Applications/Xcode/Xcode.app/Contents/Applications/Icon Composer.app/Contents/Executables/ictool" +icon_doc="$repo_root/design/brand/Burrow.icon" +output_dir_arg="${1:-design/brand/low-res}" +if [[ "$output_dir_arg" = /* ]]; then + output_dir="$output_dir_arg" +else + output_dir="$repo_root/$output_dir_arg" +fi +master="$output_dir/burrow-icon-1024.png" +checked_in_master="$repo_root/design/brand/burrow-owl-icon-master.png" +source_master="$checked_in_master" +sizes=(16 20 24 29 32 40 48 64 80 128 256) + +require_tool() { + if ! command -v "$1" >/dev/null 2>&1; then + echo "error: required tool not found: $1" >&2 + exit 127 + fi +} + +require_tool magick +require_tool awk + +if [[ ! -x "$ictool" ]]; then + echo "error: Icon Composer ictool not found at $ictool" >&2 + exit 127 +fi + +mkdir -p "$output_dir" + +if [[ "${BURROW_ICON_REFRESH:-0}" == "1" ]]; then + if ! "$ictool" "$icon_doc" \ + --export-image \ + --output-file "$master" \ + --platform iOS \ + --rendition Default \ + --width 1024 \ + --height 1024 \ + --scale 1 >/dev/null; then + echo "warning: ictool could not export $icon_doc; falling back to $checked_in_master" >&2 + magick "$checked_in_master" -colorspace sRGB -strip "PNG24:$master" + source_master="$checked_in_master" + else + source_master="$master" + fi +else + magick "$checked_in_master" -colorspace sRGB -strip "PNG24:$master" +fi + +printf "size,colors,gray_stddev,status\n" >"$output_dir/report.csv" + +for size in "${sizes[@]}"; do + image="$output_dir/burrow-icon-${size}.png" + magick "$source_master" -colorspace sRGB -resize "${size}x${size}!" -strip "PNG24:$image" + + actual="$(magick "$image" -format "%wx%h" info:)" + if [[ "$actual" != "${size}x${size}" ]]; then + echo "error: $image rendered as $actual, expected ${size}x${size}" >&2 + exit 1 + fi + + colors="$(magick "$image" -format "%k" info:)" + stddev="$(magick "$image" -colorspace Gray -format "%[fx:standard_deviation]" info:)" + min_colors=$((size * 4)) + if (( min_colors < 48 )); then + min_colors=48 + fi + if (( min_colors > 900 )); then + min_colors=900 + fi + + awk -v size="$size" -v colors="$colors" -v min_colors="$min_colors" -v stddev="$stddev" ' + BEGIN { + if (colors < min_colors) { + printf "error: %dpx icon has only %d colors; expected at least %d\n", size, colors, min_colors > "/dev/stderr"; + exit 1; + } + if (stddev < 0.08) { + printf "error: %dpx icon grayscale stddev is %.6f; expected at least 0.08\n", size, stddev > "/dev/stderr"; + exit 1; + } + } + ' + + printf "%s,%s,%s,ok\n" "$size" "$colors" "$stddev" >>"$output_dir/report.csv" +done + +preview_inputs=() +for size in 256 128 80 64 48 40 32 29 20 16; do + preview="$output_dir/preview-${size}.png" + if (( size <= 20 )); then + filter=Point + else + filter=Lanczos + fi + magick "$output_dir/burrow-icon-${size}.png" -filter "$filter" -resize 128x128 "$preview" + preview_inputs+=("$preview") +done + +magick -background "#202020" -gravity center "${preview_inputs[@]}" +append "$output_dir/preview-strip.png" + +echo "low-res icon exports written to $output_dir" diff --git a/design/brand/README.md b/design/brand/README.md index 701224f..dce22b1 100644 --- a/design/brand/README.md +++ b/design/brand/README.md @@ -46,3 +46,18 @@ for f in Apple/UI/Assets.xcassets/AppIcon.appiconset/*.png; do magick design/brand/burrow-owl-icon-master.png -colorspace sRGB -resize "${size}x${size}!" -strip "PNG24:$f" done ``` + +Run low-resolution export QA with: + +```bash +Scripts/check-brand-icon-lowres.sh +``` + +The script writes `design/brand/low-res/`, including: + +- `burrow-icon-{16,20,24,29,32,40,48,64,80,128,256}.png` +- `preview-strip.png`, a 256-to-16px visual strip scaled up for inspection +- `report.csv`, with color-count and grayscale-contrast checks + +Sizes that overlap `Apple/UI/Assets.xcassets/AppIcon.appiconset/` should remain +pixel-identical to the generated app catalog assets. diff --git a/design/brand/low-res/burrow-icon-1024.png b/design/brand/low-res/burrow-icon-1024.png new file mode 100644 index 0000000..0c74cc9 Binary files /dev/null and b/design/brand/low-res/burrow-icon-1024.png differ diff --git a/design/brand/low-res/burrow-icon-128.png b/design/brand/low-res/burrow-icon-128.png new file mode 100644 index 0000000..59f2ecc Binary files /dev/null and b/design/brand/low-res/burrow-icon-128.png differ diff --git a/design/brand/low-res/burrow-icon-16.png b/design/brand/low-res/burrow-icon-16.png new file mode 100644 index 0000000..4c08d63 Binary files /dev/null and b/design/brand/low-res/burrow-icon-16.png differ diff --git a/design/brand/low-res/burrow-icon-20.png b/design/brand/low-res/burrow-icon-20.png new file mode 100644 index 0000000..788eb35 Binary files /dev/null and b/design/brand/low-res/burrow-icon-20.png differ diff --git a/design/brand/low-res/burrow-icon-24.png b/design/brand/low-res/burrow-icon-24.png new file mode 100644 index 0000000..b9c25ac Binary files /dev/null and b/design/brand/low-res/burrow-icon-24.png differ diff --git a/design/brand/low-res/burrow-icon-256.png b/design/brand/low-res/burrow-icon-256.png new file mode 100644 index 0000000..5611e0e Binary files /dev/null and b/design/brand/low-res/burrow-icon-256.png differ diff --git a/design/brand/low-res/burrow-icon-29.png b/design/brand/low-res/burrow-icon-29.png new file mode 100644 index 0000000..2a794a9 Binary files /dev/null and b/design/brand/low-res/burrow-icon-29.png differ diff --git a/design/brand/low-res/burrow-icon-32.png b/design/brand/low-res/burrow-icon-32.png new file mode 100644 index 0000000..8cf4cde Binary files /dev/null and b/design/brand/low-res/burrow-icon-32.png differ diff --git a/design/brand/low-res/burrow-icon-40.png b/design/brand/low-res/burrow-icon-40.png new file mode 100644 index 0000000..9b95718 Binary files /dev/null and b/design/brand/low-res/burrow-icon-40.png differ diff --git a/design/brand/low-res/burrow-icon-48.png b/design/brand/low-res/burrow-icon-48.png new file mode 100644 index 0000000..3478e94 Binary files /dev/null and b/design/brand/low-res/burrow-icon-48.png differ diff --git a/design/brand/low-res/burrow-icon-64.png b/design/brand/low-res/burrow-icon-64.png new file mode 100644 index 0000000..129ee26 Binary files /dev/null and b/design/brand/low-res/burrow-icon-64.png differ diff --git a/design/brand/low-res/burrow-icon-80.png b/design/brand/low-res/burrow-icon-80.png new file mode 100644 index 0000000..20317e7 Binary files /dev/null and b/design/brand/low-res/burrow-icon-80.png differ diff --git a/design/brand/low-res/preview-128.png b/design/brand/low-res/preview-128.png new file mode 100644 index 0000000..09f0bc0 Binary files /dev/null and b/design/brand/low-res/preview-128.png differ diff --git a/design/brand/low-res/preview-16.png b/design/brand/low-res/preview-16.png new file mode 100644 index 0000000..3210f57 Binary files /dev/null and b/design/brand/low-res/preview-16.png differ diff --git a/design/brand/low-res/preview-20.png b/design/brand/low-res/preview-20.png new file mode 100644 index 0000000..d497dc6 Binary files /dev/null and b/design/brand/low-res/preview-20.png differ diff --git a/design/brand/low-res/preview-256.png b/design/brand/low-res/preview-256.png new file mode 100644 index 0000000..42e5b5a Binary files /dev/null and b/design/brand/low-res/preview-256.png differ diff --git a/design/brand/low-res/preview-29.png b/design/brand/low-res/preview-29.png new file mode 100644 index 0000000..3cf04e0 Binary files /dev/null and b/design/brand/low-res/preview-29.png differ diff --git a/design/brand/low-res/preview-32.png b/design/brand/low-res/preview-32.png new file mode 100644 index 0000000..cf74d84 Binary files /dev/null and b/design/brand/low-res/preview-32.png differ diff --git a/design/brand/low-res/preview-40.png b/design/brand/low-res/preview-40.png new file mode 100644 index 0000000..80087dd Binary files /dev/null and b/design/brand/low-res/preview-40.png differ diff --git a/design/brand/low-res/preview-48.png b/design/brand/low-res/preview-48.png new file mode 100644 index 0000000..b0627db Binary files /dev/null and b/design/brand/low-res/preview-48.png differ diff --git a/design/brand/low-res/preview-64.png b/design/brand/low-res/preview-64.png new file mode 100644 index 0000000..6c1b721 Binary files /dev/null and b/design/brand/low-res/preview-64.png differ diff --git a/design/brand/low-res/preview-80.png b/design/brand/low-res/preview-80.png new file mode 100644 index 0000000..17bcc4a Binary files /dev/null and b/design/brand/low-res/preview-80.png differ diff --git a/design/brand/low-res/preview-strip.png b/design/brand/low-res/preview-strip.png new file mode 100644 index 0000000..4c15322 Binary files /dev/null and b/design/brand/low-res/preview-strip.png differ diff --git a/design/brand/low-res/report.csv b/design/brand/low-res/report.csv new file mode 100644 index 0000000..c2b259a --- /dev/null +++ b/design/brand/low-res/report.csv @@ -0,0 +1,12 @@ +size,colors,gray_stddev,status +16,169,0.104705,ok +20,229,0.0961543,ok +24,300,0.0875631,ok +29,396,0.0974807,ok +32,446,0.0871776,ok +40,627,0.122803,ok +48,792,0.126094,ok +64,1198,0.142225,ok +80,1509,0.155485,ok +128,2577,0.171217,ok +256,4464,0.185023,ok