Skip to content

Instantly share code, notes, and snippets.

@martinemmert
Created August 24, 2014 23:33
Show Gist options
  • Save martinemmert/9ce7eb2c6799ec69304c to your computer and use it in GitHub Desktop.
Save martinemmert/9ce7eb2c6799ec69304c to your computer and use it in GitHub Desktop.
Bash script to downsize @2x.* images in the current directory...
#!/bin/bash
#simple script to downsize @2x.* images to maxWH 1024 in one folder
## create the directory to keep the lowres files
mkdir lowres
## downsize all images with @2x in the filename
sips -Z 1024 *@2x* --out lowres
## switch into the directory where the lowres files are stored
cd lowres
## remove the @2x from the filename
for i in *@2x.*; do
mv "$i" "${i/@2x/}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment