I’ve been taking pictures of receipts with my iPhone and needed a very simple system to convert the 1MB+ JPEG images to Greyscale and downsize to something smaller than 2448 x 3264.
The answer was a combination of ImageMagick and MacOS X Automator.
- Make sure Xcode is installed through AppStore. (Free)
- open a terminal, run
- Agree to Xcode license in Terminal: sudo xcodebuild -license
sudo xcodebuild -license
- http://www.macports.org/install.php and select MacPorts for your version of MacOS X.
- Download and run the installer.
- Back to terminal and run the below (will take a while to download all dependancies.)
sudo port install ImageMagick
- Now we can start to play. Open Automator (comes with Mac OS X)
- File -> New
Follow Image below:
Add the below code:
for f in "$@" do /opt/local/bin/convert "$f" -colorspace Gray -resize 640 "$f" done
Now we can drag any images onto the ConvertToBW.app and they will be converted from 1.7MB RGB to 70-100KB Greyscale and look great.