scistag.imagestag.pixel_format.PixelFormat¶
- class PixelFormat(value)[source]¶
Bases:
IntEnumEnumeration of different pixel formats
Methods
Returns a color format definition from PIL to ImageStag
Returns the corresponding PIL color format :rtype: Literal['RGB', 'RGBA', 'L', 'HSV'] | None :return: The PIL format code if a corresponding format exists, NOne otherwise
Returns the names of the single bands
Returns the (fulL) names of the single bands
Attributes
Red Green Blue
Red Green Blue Alpha
Hue Saturation Value
Blue Green Red
Blue Green Red Alpha
Grayscale
Unsupported format
Returns the count of bands this pixel type uses
Returns the data type used for the storage of pixels of this type
__doc____members____module__- classmethod from_pil(pil_format)[source]¶
Returns a color format definition from PIL to ImageStag
- Parameters
pil_format (
str) – The format string such as “rgb”- Returns
The SciStag format
- get_band_names()[source]¶
Returns the names of the single bands
- Returns
The bands, e.g. [‘R’, ‘G’, ‘B’]
- get_full_band_names()[source]¶
Returns the (fulL) names of the single bands
- Returns
The bands, e.g. [‘Red’, ‘Green’, ‘Blue’]
- to_pil()[source]¶
Returns the corresponding PIL color format :rtype: Literal[‘RGB’, ‘RGBA’, ‘L’, ‘HSV’] | None :return: The PIL format code if a corresponding format exists, NOne
otherwise
- BGR = 5¶
Blue Green Red
- BGRA = 6¶
Blue Green Red Alpha
- GRAY = 10¶
Grayscale
- HSV = 2¶
Hue Saturation Value
- RGB = 0¶
Red Green Blue
- RGBA = 1¶
Red Green Blue Alpha
- UNSUPPORTED = 99¶
Unsupported format