Convert an Image to Grayscale with ImageMagick

By  on  
Grayscale Logo

A few years ago I bought a DSLR camera with a bunch of filter effects built in and it's been worth every penny.  I took some incredible photos in London, Paris, and Jamaica, and tooks some really special photos of my son during his first few years.  And many of my favorite photos were taken with grayscale filter but some I took in color and badly wanted them in grayscale.  Of course I can use Photoshop to convert the image to grayscale but that's too much work.  I have ImageMagick -- why not use the shell to very quickly convert it to grayscale?

Converting the image to grayscale with ImageMagick is simple:

convert my-image.jpg -colorspace Gray my-image-gray.jpg

The command is self-explanatory and executes in milliseconds.  And since Photoshop takes a few seconds to start and I have to do the work manually, ImageMagick makes everything so much easier.

Recent Features

  • By
    5 Awesome New Mozilla Technologies You’ve Never Heard Of

    My trip to Mozilla Summit 2013 was incredible.  I've spent so much time focusing on my project that I had lost sight of all of the great work Mozillians were putting out.  MozSummit provided the perfect reminder of how brilliant my colleagues are and how much...

  • By
    Create a CSS Flipping Animation

    CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there's...

Incredible Demos

Discussion

  1. MaxArt

    How about sepia tones? After all, it’s just like converting to grayscale with a different balance of red, green and blue.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!