Convert image to monochrome using MSL
Posted: 2009-05-07T09:35:17-07:00
I am new to IM and need some help with MSL. I would like to use MSL to convert photographs to monochrome MONO format.
I need to do the following:
- resize the image to 160x120 pixels
- rotate 180 degrees
- everything black or dark gray needs to be black
- everything else (all other colors dark or light) need to be white
Here is the first version of MSL that does not do exactly what I like because it converts colors to grayscale before creating a monochrome image:
<image>
<read filename="input.jpg" />
<resize width="160" height="120" />
<rotate degrees="180" />
<quantize dither="true" colors="2" colorspace="gray" />
<normalize />
<write filename="output.mono" />
</image>
Any ideas for accomplishing what I need or doing things better will be greatly appreciated!
I need to do the following:
- resize the image to 160x120 pixels
- rotate 180 degrees
- everything black or dark gray needs to be black
- everything else (all other colors dark or light) need to be white
Here is the first version of MSL that does not do exactly what I like because it converts colors to grayscale before creating a monochrome image:
<image>
<read filename="input.jpg" />
<resize width="160" height="120" />
<rotate degrees="180" />
<quantize dither="true" colors="2" colorspace="gray" />
<normalize />
<write filename="output.mono" />
</image>
Any ideas for accomplishing what I need or doing things better will be greatly appreciated!