You should be able to do this by extracting the blue channel to grayscale with the "-channel" option. See http://kungfool.transpect.net/webpages/tutorials/mcTut002.html for an illustration of the technique.
The command will be something like "gm convert -channel blue sketch.png cleanup.png".
It's not perfect, but maybe that will get you down the road. You might also try thresholding the grayscale image to clean it up further.
Jos'h Fuller, Production Engineer
p: 416.682.5200 x5395 | f: 416.682.5209
Starz Animation Toronto | 230 Richmond Street East | Toronto, ON M5A 1P4
From: Bob Friesenhahn <bfriesen@si...> - 2010-03-01 16:44:46
On Sat, 27 Feb 2010, Hibiki Kanzaki wrote:
> I have graph paper with blue lines, and I want to
> replace the blue color with white to make the lines
> go away. How do I do this with GraphicsMagick
> (any technique is fine).
Assuming that there is no other blue that you want to save and the
blue is really blue, you could remove the content of the blue channel
entirely using this:
gm convert infile.jpg -operator blue Threshold-Black 100% outfile.jpg
If you need something more sophisticated, then see the -opaque option,
which allows replacing a specified color with the color specified by
-fill and within the range specifed by -fuzz.
gm convert infile.jpg -fill red -fuzz 20% -opaque '#013B53' outfile.jpg
In this case you need to be able to specify the color you want to
replace reasonably accurately, and then adjust the -fuzz option until
you get the desired degree of replacement.
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/