Home : Image Processing : Image Clean-up/Correction Techniques : Set a Default PixelFormatChanger for use by ApplyToAnyPixelFormat
Q10374 - HOWTO: Set a Default PixelFormatChanger for use by ApplyToAnyPixelFormat

In a situation where you want to use an Atalasoft ImageCommand that required PixelFormat.Pixel1bppIndexed

If you set the ApplyToAnyPixelFormat flag, the command will process without throwing a pixel format exception, but the process will use GetChangedPixelFormat(PixelFormat.Pixel1bppIndexed) which is a very "brute force" pixel change and does not properly set certain key properties needed to make a "true black and white image" from your original.

Also, it tends to make some very arbitrary choices as to what pixels will be "Min" and what pixels will be "Max" as well as not guaranteeing that your "min" is black and your "max" is white (or vice versa depending on photometric interpretation).

The way to force these default pixel changes to use a means that includes a Thresholding Command (one that makes a true black and white and makes better decisions about which pixels to make black and which to make white), you can add this one line of code to the static constructor for your class:

AtalaImage.PixelFormatChanger = new DocumentPixelFormatChanger(new AtalaPixelFormatChanger());

 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved