This project has moved. For the latest updates, please go here.

Convert command to .NET

Jan 15, 2015 at 6:58 PM
Hi,
I have this code(get in... http://www.imagemagick.org/discourse-server/viewtopic.php?t=25557)
convert entry.jpg -threshold 10% -morphology close:2 "1x4: 0,1,1,0" -normalize out.jpg
convert out.jpg -write MPR:source -morphology close rectangle:7x3 -clip-mask MPR:source -morphology erode:8 square +clip-mask r.jpg
convert r.jpg -filter Box -resize 320x240+0+0 -noise 5 -median 5 -unsharp 0x1+0.25+0 -quality 86% -sampling-factor 1x1 -despeckle -sharpen 2 -normalize -negate -verbose -morphology Thinning 3:0,0,0,0,1,0,0,0,0 -negate pre_final.jpg
convert pre_final.jpg -negate -morphology Thinning "4x4:0,0,0,0, 0,1,1,0, 0,1,1,0, 0,0,0,0" -morphology Thinning:5 LineEnds -morphology Thinning "3:0,0,0, 0,1,0, 0,0,0" -negate final.jpg
Can someone help out or give pointers in the right direction (or is there a better way to solve this, like converting to MagickScript somehow)?
Coordinator
Jan 15, 2015 at 7:19 PM
I am not that comfortable translating your command since it looks like a piece of code to defeat captcha. I will however give you some pointers to do it yourself. Most options of the command line are methods of the MagickImage class. For example -threshold 10% will translate MagickImage.Threshold(10). The rest is left as an exercise for the reader.