FredsImageMagickScripts.Autotrim

Automatically trim a (nearly) uniform color border around an image. If the image is rotated, one can trim to the bounding box around the image area or alternately trim to the maximum central area that contains no border pixels. The excess border does not have to completely surround the image. It may be only on one side. However, one must identify a coordinate within the border area for the algorithm to extract the base border color and also specify a fuzz value when the border color is not uniform. For simple border trimming of a normally oriented image or the bounding box of a rotated image, you may err somewhat towards larger than optimal fuzz values. For images that contain rotated picture data, when you want to trim to the central area, you should choose the smallest fuzz value that is appropriate. For images that contain rotated picture data, an estimate of the rotation angle is needed for the algorithm to work. However, setting the rotation angle to zero will let the algorithm determine the rotation angle. The resulting trim is usually pretty good for angles >= 5 degrees. If the result is off a little, you may use the left/right/top/bottom arguments to adjust the automatically determined trim region.


Keywords
Fred, Weinhaus, ImageMagick, Autotrim
License
Other
Install
Install-Package FredsImageMagickScripts.Autotrim -Version 2.2020.822.858

Documentation

ImageMagick.FredsScripts.NET

GitHub license Build Status

This projects goal is to port most of the scripts for ImageMagick that are created by Fred Weinhaus to C#. With the help of Magick.NET a library will be created that will make it easy to use Fred's scripts in .NET.

License

This project uses the same license as Fred's ImageMagick Scripts. You can find the license in the LICENSE.md file.

Scripts

The scripts below have been ported to .NET and can be found on NuGet. Not all scripts have been ported at the moment. Create an issue if you want a specific script to be ported to C#.

Script Download Original
Autotrim download original
Cartoon download original
DraganEffect download original
Embroidery download original
TextCleaner download original
Tshirt download original
TwoColorThresh download original
Unperspective download original
Whiteboard download original

Collaborators

Script Name
Cartoon Christoph Bergmeister