Gimpformats Index / Gimpformats / Gimpimagehierarchy
Auto-generated documentation for gimpformats.GimpImageHierarchy module.
Show source in GimpImageHierarchy.py:16
Represents packed pixels from a GIMP image hierarchy.
Note that the XCF docs say this was originally designed as a hierarchy, but currently only the top level (lptr) is used
uint32 width Width of the pixel array uint32 height Height of the pixel array uint32 bpp Number of bytes per pixel; this depends on the color mode and image precision (fields 'base_type' and 'precision' of the image header). For instance, some combination values: 3: RGB color without alpha in 8-bit precision 4: RGB color with alpha in 8-bit precision 6: RGB color without alpha in 16-bit precision 16: RGB color with alpha in 32-bit precision 1: Grayscale without alpha in 8-bit precision 4: Grayscale with alpha in 16-bit precision 1: Indexed without alpha (always 8-bit) 2: Indexed with alpha (always 8-bit) And so on.
pointer lptr Pointer to the "level" structure ,-------- ------ Repeat zero or more times | pointer dlevel Pointer to an unused level structure (dummy level) `-- pointer 0 Zero marks the end of the list of level pointers. .
class GimpImageHierarchy(GimpIOBase):
def __init__(self, parent, image: Image.Image | None = None) -> None: ...Show source in GimpImageHierarchy.py:141
Get a textual representation of this object.
def __repr__(self) -> str: ...Show source in GimpImageHierarchy.py:137
Get a textual representation of this object.
def __str__(self) -> str: ...Show source in GimpImageHierarchy.py:58
Decode packed pixels from a byte buffer.
def decode(self, data: bytearray, index: int = 0) -> int: ...Show source in GimpImageHierarchy.py:88
Encode packed pixels data into a byte buffer.
def encode(self, offset: int = 0) -> bytearray: ...Show source in GimpImageHierarchy.py:122
Get a final, compiled image.
@property
def image(self) -> Image.Image | None: ...Show source in GimpImageHierarchy.py:127
Set the image.
@image.setter
def image(self, image: Image.Image) -> None: ...Show source in GimpImageHierarchy.py:108
Get the levels within this hierarchy.
Presently hierarchy is not really used by gimp, so this returns an array of one item
@property
def levels(self) -> list[GimpImageLevel]: ...