Skip to content

Instantly share code, notes, and snippets.

@mreidsma
Created October 28, 2013 15:56
Show Gist options
  • Select an option

  • Save mreidsma/7199436 to your computer and use it in GitHub Desktop.

Select an option

Save mreidsma/7199436 to your computer and use it in GitHub Desktop.
A quick Bash script to convert a folder full of .pngs to .tiffs @ 300dpi for book figures. (Handy for books with lots of screen shots)
#!/bin/bash
for file in ~/Desktop/old_figures/*
do
sips --setProperty dpiHeight 300.000 --setProperty dpiWidth 300.000 --setProperty format tiff --setProperty formatOptions lzw $file --out ~/Desktop/new_figures/`basename $file .png`.tiff
done
@mreidsma
Copy link
Copy Markdown
Author

Put yer old 72 dpi png screen shots in a folder on your desktop called "old_figures".

Make a new directory on yer desktop called "new_figures"

Open your favorite text editor. Paste this code in and save it as "convert." Put it on your desktop.

Open Terminal.app. Type:

cd ~/Desktop [hit enter]

Now type: ./convert

WATCH THE MAGIC HAPPEN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment