To have the toolkit generate the array of colors:
If the image is grayscale (not binary) call the GrayScaleToMultitoneCommand with Distribution set to GrayScaleToMultitoneCommandDistributionType.Linear. The GrayScaleToMultitoneCommand will take the color(s) set in the Color property and generate a 256 color gradient for each color.
If the image is not grayscale (it is color) call the GrayScaleToMultitoneCommand with Distribution set to GrayScaleToMultitoneCommandDistributionType.Linear. The GrayScaleToMultitoneCommand will take the color(s) set in the Color property and generate a 256 color gradient for each color. These colors will be used to change only those pixels in the color image for which Red = Green = Blue.
To use a user-defined array of colors:
If the image is grayscale (not binary) call GrayScaleToMultitoneCommand with Distribution set to GrayScaleToMultitoneCommandDistributionType.UserDefined.
If the image is not grayscale (it is color) call GrayScaleToMultitoneCommand with Distribution set to GrayScaleToMultitoneCommandDistributionType.UserDefined. (See the expanded explanation in i, ii and iii of (b) above.) These colors will be used to change only those pixels in the color image for which Red = Green = Blue.
For more information, refer to Introduction to Image Processing With LEADTOOLS. For more information, refer to Grayscale Images.
Run the GrayScaleToMultitoneCommand on an image.