"Peter Desjardins" on wrote...
| I am using Imagemagick to bring scanned images that are in
a variety of
| conditions into line with a set of requirements. The
images are being
| used by another piece of software that has a maximum
allowable file
| size.
|
| I've been trying to get Imagemagick to do three things:
|
| 1. Limit the number of pixels to 150ppi. The scans are of
8.5 inch by
| 11 inch paper
| so we want no more than 1276 x 1650 pixels. These are
images of
| forms and they
| only need to be legible, not photo quality.
|
| 2. Remove all color information. Black and white is
sufficient.
|
| 3. Convert to GIF.
|
| The source images are in most cases PDF and often 300ppi
with color.
| The results I get with the following command are not
legible.
|
| convert -resample "150" -monochrome
too-big-scan.pdf
| just-right-size.gif
|
| Using Adobe Photoshop and Imageready I can convert the
same file to
| 150ppi, black and white GIF and the results are legible
(reasonable fax
| quality). This needs to be scripted for people who don't
have Photoshop
| though.
|
| Am I choosing the wrong options? Is there a better way to
perform this
| task?
Did the image come out the right size?
You could just -resize or -scale the image directly to the
right
pixel size needed.
Next, you need to consider cleaning up 'speckles' that may
be present
from the scanning process. -despeckle and -median are
two such ways.
Another is to blur the image slightly before trying to
convert to black
and white.
As for the conversion to black and white....
You can
grey scale the image, then threshold it at an appropriate
level,
dithered monocrome,
(which you said came out horible, probably due to the
dithering)
two color quantization (dithered or un-dithered)
user supplied colormap reduction.
Just to name a few.
Most of these are exampled in IM Examples, Quantization and
Dithering.
http://www
.imagemagick.org/Usage/quantize/
And please give us some feedback on your success and
failures, and what
you found was the right solution.
For example I would like to add a 'scanning' section to IM
examples
but have no small but difficult examples (Say a 100x100
pixel
area cropped from a real scan) to work/play with.
You should have no problem with saving B&W images to
GIF, shold work
very well as is.
Anthony Thyssen ( System Programmer ) <A.Thyssen griffith.edu.au>
-----------------------------------------------------------
------------------
"Mr. Worf, scan that ship." "Aye,
Captain... 300 DPI?"
-----------------------------------------------------------
------------------
Anthony's Home is his Castle http://www.cit.gu.
edu.au/~anthony/
_______________________________________________
Magick-users mailing list
Magick-users imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick
-users
|