#2 – One for each hand – The AutoCropCommand
Sure, this one should be pretty straightforward. As the name implies, this command automatically crops the solid color border from the edge of an image. It is available for DotImage Photo, Photo Pro, and Document Imaging.
Setting parameters wouldn’t be very… “automatic”… now, would it? But there are some details we can set for this one:
- OverrideColor – you can set a specific color to represent the image’s “empty” space.
- OverrideIndex – similar to the OverrideColor, this sets a palette index value instead of a color
- Tolerance – this is the percentage used to locate the edges.
- UseMedianFilter – lets you clean up the image a little bit before getting the result dimensions .(good if you have some noise or artifacts keeping you from getting the entire edge cropped).
Here’s the command in action. I’ve left all of my settings as default values except for Tolerance, which I set to 1 (because 0 results in nothing).
Before (overall image’s size is 640 x 478 pixels):
After (overall image’s size is 512 x 359):
Not much difference to show off here, other than to take note that the cropped image is not resampled to the original size.
Next up is the ChangePixelFormatCommand. Hardly ever used, but very important to people everywhere. Like sporks.