Skip to content

Instantly share code, notes, and snippets.

@davps
Last active August 30, 2017 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davps/90d94e68355470f20bc6354a157f7f2a to your computer and use it in GitHub Desktop.
Save davps/90d94e68355470f20bc6354a157f7f2a to your computer and use it in GitHub Desktop.
Imagemagick scripts I frequently use

Installation

brew install imagemagick

brew install ghostscript

brew install ufraw

netpbm dcraw

Convert all .NET image extensions to .JPG

for img in *.NEF; do convert "$img" "$img.jpg"; done

source: http://superuser.com/a/577661

to move the converted JPG files on a ./temp folder:

for img in *.NEF; do convert "$img" "./temp/$img.jpg"; done

Batch resize of images in a folder

cd to the directory where your images are located (temp) after creating a new directory to hold the changed files (say, temp2)

mogrify -path ./temp2/ -resize 40x40% -quality 60 -format jpg *.jpg

this will take all png files in your current directory (temp), resize to 60% (of largest dimension and keep aspect ratio), set jpg quality to 60 and convert to jpg.

source: http://www.imagemagick.org/discourse-server/viewtopic.php?t=14587

Add a logo image to a photo

composite  -gravity NorthEast logo.png photo.jpg output.jpg

Here is a good reference about compose http://www.imagemagick.org/Usage/compose/

Gimp tips

Suavizar bordes http://jafty.com/blog/fixing-jagged-image-edges-with-gimp/

Cambiar resolucion de imagen http://guides.lib.umich.edu/c.php?g=282942&p=1888162

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