> convert -set 'option:deskew:auto-crop 10' scan9.pnm scan92.pnm
Notice the option:deskew. This means it only works with the -deskew option.
Also don't use the quotes. We'll fix the documentation.
Programmically we auto crop by running a median filter across the image
to eliminate salt-n-pepper noise. Next we get the image bounds of the
median filter image with a fuzz factor (e.g. -fuzz 5%). Finally we
crop the original image by the bounds. The code looks like this:
median_image=MedianFilterImage(image,0.0,exception);
geometry=GetImageBoundingBox(median_image,exception);
print(" Auto-crop geometry: %lux%lu%+ld%+ld",geometry.width,geometry.height,
geometry.x,geometry.y);
crop_image=CropImage(rotate_image,&geometry,exception);
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users