Skip to content

Instantly share code, notes, and snippets.

@onnyyonn
Created September 7, 2024 18:00
Show Gist options
  • Select an option

  • Save onnyyonn/6a7ac72f1b55ff615e91886adbe48ac5 to your computer and use it in GitHub Desktop.

Select an option

Save onnyyonn/6a7ac72f1b55ff615e91886adbe48ac5 to your computer and use it in GitHub Desktop.
Batch half-pixel blur
#!/bin/bash
export_dir="Export"
share_dir="Share"
mkdir -p "$share_dir"
overwrite=false
if [[ "$1" == "-overwrite" ]]; then
overwrite=true
fi
for image in "$export_dir"/*.png; do
base_name=$(basename "$image")
blurred_image="$share_dir/${base_name}"
if $overwrite || [[ ! -f "$blurred_image" ]]; then
magick "$image" -blur 0x0.5 "$blurred_image"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment