Skip to content

Instantly share code, notes, and snippets.

@kostasx
Created December 17, 2012 23:08
Show Gist options
  • Save kostasx/4323295 to your computer and use it in GitHub Desktop.
Save kostasx/4323295 to your computer and use it in GitHub Desktop.
Apply a lomo effect to an image using ImageMagick. ( Requirements: ImageMagick + "curves" script by Fred Weinhaus: http://www.fmwconcepts.com/imagemagick/curves/index.php )
#!/bin/bash
## Split Image into Separate RGB Channels
convert -channel R -separate $1 tmpR.bmp
convert -channel G -separate $1 tmpG.bmp
convert -channel B -separate $1 tmpB.bmp
## Apply Curves Transformation on Each Channel (Lomo Effect)
./curves -s 255,255 "120,140" tmpR.bmp tmpRc.bmp
./curves -s 255,255 "75,55 185,200" tmpG.bmp tmpGc.bmp
./curves -s 255,255 "140,120" tmpB.bmp tmpBc.bmp
## Combine Separate Channels into an RGB Image
convert -combine -channel RGB tmpRc.bmp tmpGc.bmp tmpBc.bmp lomo.jpg
## Clean Up Temporary Files
rm tmpR.bmp tmpG.bmp tmpB.bmp tmpRc.bmp tmpGc.bmp tmpBc.bmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment