Skip to content

Instantly share code, notes, and snippets.

@fwilhe
Last active June 16, 2016 18:20
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 fwilhe/936f826804e81e566e4cfab2640c6bc7 to your computer and use it in GitHub Desktop.
Save fwilhe/936f826804e81e566e4cfab2640c6bc7 to your computer and use it in GitHub Desktop.
Experimentation with Color Channels
#!/bin/bash
# picture licence: cc-by-sa Nakiel
wget https://upload.wikimedia.org/wikipedia/commons/e/e2/1213303317_gal_dsc_4158_02.jpg -O natur.jpg
convert natur.jpg natur.png
rm natur.jpg
# create separate pictures for each chanel in RGB, CMY and CMYK models.
convert natur.png -separate natur_RGB_%d.png
convert natur.png -colorspace CMY -separate natur_CMY_%d.png
convert natur.png -colorspace CMYK -separate natur_CMYK_%d.png
# create a montage of the pictures
montage -border 0 -geometry 660x natur.png natur_RGB*.png RGB.png
montage -border 0 -geometry 660x natur.png natur_CMY_*.png CMY.png
montage -border 0 -geometry 660x natur.png natur_CMYK*.png CMYK.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment