Color space conversions supported by the Foundation Package.
More...
Color space conversions supported by the Foundation Package.
◆ SwapChannels()
static Image SwapChannels |
( |
Image |
img, |
|
|
int[] |
newArrangement |
|
) |
| |
|
static |
Create a new image by rearranging the planes of the input image.
This method differs from ImagePlaneCollection.Map(IEnumerable<int>) in that this creates a new interleaved image buffer instead of just giving a new view on the data.
- Parameters
-
img | Input image. |
newArrangement | Array that defines the new plane arrangement. For example for an RGB image, the array [2,1,0] would cause the image planes to be rearranged to BGR plane order. |
- Returns
- New transformed image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToCieLab16()
Convert the input image to CIE Lab with DataTypes.Int16BppUnsigned for better precision.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToCieLab8()
Convert the input image to CIE Lab with DataTypes.Int8BppUnsigned.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToCieLUV()
Convert the input image to CIE LUV.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToCieXYZ()
Convert the input image to CIE XYZ.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToHLS()
Convert the input image to HLS.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToHSV()
Convert the input image to HSV.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToMono() [1/3]
Convert the input image to mono.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToMono() [2/3]
static Image ToMono |
( |
Image |
img, |
|
|
double |
weightR, |
|
|
double |
weightG, |
|
|
double |
weightB |
|
) |
| |
|
static |
Convert the input image to mono.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
weightR | Weight (multiplier) for the red channel |
weightG | Weight (multiplier) for the green channel |
weightB | Weight (multiplier) for the blue channel |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToMono() [3/3]
Convert the input image to mono.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
conversion | Weighting method to apply |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToRGB()
Convert the input image to RGB.
- Parameters
-
- Returns
- New converted image.
- Exceptions
-
InvalidCastException | If the input image has an unknown/inconvertible color model |
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToRGBFrom()
Convert the input image to RGB.
This method differs from ToRGB(Image) in that if the color model is ColorModel.RGBGuess instead assumedColorModel is used.
With that you can build your own images consisting of the desired color space and convert it to RGB.
- Parameters
-
img | Input image. |
assumedColorModel | In cases where the color model of the input image is not known (indicated by the value ColorModel.RGBGuess), the source image's color model should be assumed to be the one provided in assumedColorModel . |
- Returns
- New converted image.
- Exceptions
-
InvalidCastException | If the input image has an unknown/inconvertible color model |
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToYCbCr()
Convert the input image to YCbCr.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToYCC()
Convert the input image to YCC.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ ToYUV()
Convert the input image to YUV.
If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.
- Parameters
-
img | Image to be converted. |
- Returns
- New converted image.
- Exceptions
-
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
◆ TwistColors()
Apply the given matrix to the given img .
- Parameters
-
img | Image to apply the matrix to |
matrix | Matrix defining the color twist transformation. |
- Returns
- Transformed image