Created
December 17, 2012 23:08
-
-
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 )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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