How to make black and white image?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".

How to make black and white image?

Postby Lukas1234 » 2008-05-19T20:04:49+00:00

Function monochrome doesnt work since it making it picture look weird.I think proper function will be channel,but i dont know what i need to type exactly.For example in program gimp making black/white picture is called desaturate/lightning
Lukas1234
 

Re: How to make black and white image?

Postby fmw42 » 2008-05-19T20:27:50+00:00

I am not sure what you mean by "black and white"? Two colors only?

If you want grayscale from color, you can type:

convert <input> -colorspace Gray <output>

or

convert <input> -type Grayscale <output>

These will convert color to gray.

However, if you want two colors only (black and white), then you need to threshold, for example, to select the color where above will be white and below will be black

convert <input> -threshold xx% <output>

where xx is in range 0-100 (for percent)
User avatar
fmw42
 
Posts: 13875
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: How to make black and white image?

Postby Lukas1234 » 2008-05-20T03:53:21+00:00

First command works fine,thank you.
Lukas1234
 


Return to Users

Who is online

Users browsing this forum: Sibrah and 20 guests