Skip to content

Instantly share code, notes, and snippets.

@LastZactionHero
Created August 1, 2018 21:01
Show Gist options
  • Save LastZactionHero/0384117c2410548af286c3ecbed0362d to your computer and use it in GitHub Desktop.
Save LastZactionHero/0384117c2410548af286c3ecbed0362d to your computer and use it in GitHub Desktop.
ImageMagick Covert and Color
# Convert to smaller, monochrome
convert source.jpg -monochrome -resize 320x240 output.jpg
# Convert to gray samples
convert output.jpg gray:output.gray
# Convert back from monchrome samples to jpg (unnecessary)
convert -size 320x240 -depth 8 output.gray rebuild.jpg
# Convert monchrome JPG to RGB colorspace
convert rebuild.jpg -colorspace sRGB -type truecolor rebuild.jpg
# Draw at a point
convert rebuild.jpg -fill red -draw 'color 5,5 point' colored.jpg
convert colored.jpg -fill red -draw 'color 5,4 point' colored.jpg
convert colored.jpg -fill red -draw 'color 5,6 point' colored.jpg
convert colored.jpg -fill red -draw 'color 4,5 point' colored.jpg
convert colored.jpg -fill red -draw 'color 6,5 point' colored.jpg
# Cleanup
rm output.gray
rm output.jpg
rm rebuild.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment