pyguymer3.image.makePngSrc.createStream¶
- pyguymer3.image.makePngSrc.createStream(arrUint8, arrInt16, /, *, calcAdaptive: bool = True, calcAverage: bool = True, calcNone: bool = True, calcPaeth: bool = True, calcSub: bool = True, calcUp: bool = True, choices: str = 'all', debug: bool = True, levels: None | list[int] = None, memLevels: None | list[int] = None, strategies: None | list[int] = None, wbitss: None | list[int] = None) bytearray[source]¶
Compress the PNG image data stream
This function loops over sets of settings and returns the smallest compressed PNG image data stream. See
pyguymer3.image.makePng()for a discussion on how it does that.- Parameters:
arrUint8 (numpy.ndarray) – A “height * width * colour” unsigned 8-bit integer NumPy array.
arrInt16 (numpy.ndarray) – A signed 16-bit integer NumPy array copy of
arrUint8.calcAdaptive (bool, optional) – See
pyguymer3.image.makePng()for the documentation.calcAverage (bool, optional) – See
pyguymer3.image.makePng()for the documentation.calcNone (bool, optional) – See
pyguymer3.image.makePng()for the documentation.calcPaeth (bool, optional) – See
pyguymer3.image.makePng()for the documentation.calcSub (bool, optional) – See
pyguymer3.image.makePng()for the documentation.calcUp (bool, optional) – See
pyguymer3.image.makePng()for the documentation.choices (str, optional) – See
pyguymer3.image.makePng()for the documentation.debug (bool, optional) – Print debug messages.
levels (None or list of int, optional) – See
pyguymer3.image.makePng()for the documentation.memLevels (None or list of int, optional) – See
pyguymer3.image.makePng()for the documentation.strategies (None or list of int, optional) – See
pyguymer3.image.makePng()for the documentation.wbitss (None or list of int, optional) – See
pyguymer3.image.makePng()for the documentation.
- Returns:
stream – The compressed PNG image data stream.
- Return type:
Notes
Copyright 2017 Thomas Guymer [1]
References