From 76acbfea5ad5f3c0fb3a19c8afe843c4f5f533d1 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Tue, 6 Apr 2021 13:27:17 -0700 Subject: [PATCH] zsh: img-placeholder --- zsh/aliases | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zsh/aliases b/zsh/aliases index 19be38e..a8849f9 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -80,3 +80,15 @@ mov2gif() { relpath() { realpath --relative-to=. "$1" } + +img-placeholder() { + local size="$1" # WxH + local outfile='' + if [ "$#" -gt 1 ]; then + outfile="$2" + else + outfile="${size}.png" + fi + magick -size "${size}" -background lime -gravity Center caption:"${size}" "${outfile}" + echo "${outfile}" +}