Gimpformats Index / Gimpformats / Gimppatpattern
Auto-generated documentation for gimpformats.GimpPatPattern module.
Show source in GimpPatPattern.py:14
Pure python implementation of a gimp pattern file.
See: https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/pat.txt
class GimpPatPattern:
def __init__(self, fileName: BytesIO | str | None = None) -> None: ...Show source in GimpPatPattern.py:141
Get a textual representation of this object.
def __repr__(self) -> str: ...Show source in GimpPatPattern.py:137
Get a textual representation of this object.
def __str__(self) -> str: ...Show source in GimpPatPattern.py:51
Decode a byte buffer.
databytearray - data to decodeindexint, optional - index to start from. Defaults to 0.
RuntimeError- "File format error. Magic value mismatch."
int- pointer
def decode(self, data: bytearray | bytes, index: int = 0) -> int: ...Show source in GimpPatPattern.py:85
Encode to a byte buffer.
def encode(self) -> bytearray: ...Show source in GimpPatPattern.py:107
Get a final, compiled image.
@property
def image(self) -> Image.Image | None: ...Show source in GimpPatPattern.py:116
@image.setter
def image(self, image: Image.Image) -> None: ...Show source in GimpPatPattern.py:43
Load a gimp file.
fileName- can be a file name or a file-like object
def load(self, fileName: BytesIO | str | Path) -> None: ...Show source in GimpPatPattern.py:121
Save this gimp image to a file.
def save(
self, tofileName: Path | str | BytesIO, toExtension: str | None = None
) -> None: ...Show source in GimpPatPattern.py:102
The size of the pattern.
@property
def size(self) -> tuple[int, int]: ...