ImageGear22.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class > ConvertColorSpace Method : ConvertColorSpace(ImGearRasterPage,ImGearColorSpace,Boolean,ImGearPixel) Method |
'Declaration Public Overloads Shared Sub ConvertColorSpace( _ ByVal page As ImGearRasterPage, _ ByVal newColorSpace As ImGearColorSpace, _ ByVal doNotScalePixels As Boolean, _ ByVal backgroundColor As ImGearPixel _ )
'Usage Dim page As ImGearRasterPage Dim newColorSpace As ImGearColorSpace Dim doNotScalePixels As Boolean Dim backgroundColor As ImGearPixel ImGearRasterProcessing.ConvertColorSpace(page, newColorSpace, doNotScalePixels, backgroundColor)
public static void ConvertColorSpace( ImGearRasterPage page, ImGearColorSpace newColorSpace, bool doNotScalePixels, ImGearPixel backgroundColor )
public: static void ConvertColorSpace( ImGearRasterPage* page, ImGearColorSpace newColorSpace, bool doNotScalePixels, ImGearPixel* backgroundColor )
public: static void ConvertColorSpace( ImGearRasterPage^ page, ImGearColorSpace newColorSpace, bool doNotScalePixels, ImGearPixel^ backgroundColor )
If conversion removes the alpha channel from an image, the image is composited over a solid background specified by BackColor. BackColor should be in the same color space as the original image, but without the Alpha channel. For example, if original image is in RGBA color space and newColorSpace is CMYK, BackColor should have RGB color space. The method will first transform the image into RGB and then to CMYK.
The following formula is used to burn alpha (i.e., to convert from RGBA/P to RGB):
If the image contains extra channels, and newColorSpace contains extra channels, the method does not change them.
Note: Conversion to Grayscale colorspace takes into account the human eye's sensitivity to different parts of the light spectrum. ImageGear uses the following formula when converting from RGB to Grayscale: Gray = Gray = Red * 77 / 255 + Green * 151 / 255 + Blue * 28 / 255.