Skip to content

Instantly share code, notes, and snippets.

@dfrankland
Forked from gingertom/resizer.sh
Last active February 15, 2021 21:42
Show Gist options
  • Save dfrankland/a125d5f652f5474de76ea9a89ce63006 to your computer and use it in GitHub Desktop.
Save dfrankland/a125d5f652f5474de76ea9a89ce63006 to your computer and use it in GitHub Desktop.
Simple `imagemagick` fish shell script to convert all @2x images in a directory to @1x. Place file in `~/.config/fish/functions/`, then run like normal: `resize`!
function resize --description "Resize images from @2x to @1x in current directory."
for image in *
echo $image | grep -qE '.*@2x.*'; and \
convert $image -resize 50% (echo $image | sed "s/@2x/@1x/g")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment