IBitmapDataWorkingColorSpace Property

Gets the preferred working color space when dealing with the pixels of this IBitmapData instance. Some operations, such as setting pixels or drawing another bitmap data into this instance consider the value of this property. Operations that use an IQuantizer instance may override the value of this property.
Default value if not implemented: Default. (Only in .NET Core 3.0/.NET Standard 2.1 and above. In earlier targeted frameworks this member must be implemented.)


Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.0.0-preview.1
WorkingColorSpace WorkingColorSpace { get; }

Property Value




See the Remarks section of the WorkingColorSpace enumeration for details and image examples about using the different color spaces in various operations.

For IBitmapData implementations the WorkingColorSpace property primarily determines how to blend colors in drawing operations or when this IBitmapData does not support transparency and partially transparent colors are set by the IWritableBitmapData or IWritableBitmapDataRow members. Custom IBitmapData implementations may ignore the value of this property. Some other operations such as cloning, resizing, etc. may also respect the value of this property.

When WorkingColorSpace is Default, the working color space is chosen based on the context. For example, when setting a pixel using the Color32 type, the sRGB blending will be picked (unless PixelFormat has the LinearGamma flag enabled) because it is faster, and it is the default behavior for most applications.

For some operations, such as drawing a bitmap data into another one by the DrawInto methods the working color space is determined by the WorkingColorSpace of the target bitmap data.

When using a quantizer for some operations, it may override the value of this property. As quantizers are limited to the 32 bit ARGB color space, the built-in IQuantizer implementations in this library also use sRGB blending by default but you can override it by the PredefinedColorsQuantizer.ConfigureColorSpace and OptimizedPaletteQuantizer.ConfigureColorSpace methods.

See Also