Encoders & Presets API¶
Compression configuration, encoder parameter controls, and speed preset options.
HeifEncoder¶
pylibheif.HeifEncoder ¶
init(self, format: pylibheif._pylibheif.HeifCompressionFormat, preset: str = '') -> None init(self, descriptor: pylibheif._pylibheif.HeifEncoderDescriptor, preset: str = '') -> None
__module__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
parameters
property
¶
Retrieve or create cached parameter proxy for a HeifEncoder instance.
__new__
builtin
¶
Create and return a new object. See help(type) for accurate signature.
encode_image
method descriptor
¶
encode_image(self, ctx: pylibheif._pylibheif.HeifContext, image: pylibheif._pylibheif.HeifImage, preset: str = '', options: pylibheif._pylibheif.HeifEncodingOptions | None = None) -> pylibheif._pylibheif.HeifImageHandle
encode_thumbnail
method descriptor
¶
encode_thumbnail(self, ctx: pylibheif._pylibheif.HeifContext, image: pylibheif._pylibheif.HeifImage, master_image: pylibheif._pylibheif.HeifImageHandle, bbox_size: int, options: pylibheif._pylibheif.HeifEncodingOptions | None = None) -> pylibheif._pylibheif.HeifImageHandle | None
get_boolean_parameter
method descriptor
¶
get_boolean_parameter(self, arg: str, /) -> bool
get_integer_parameter
method descriptor
¶
get_integer_parameter(self, arg: str, /) -> int
get_string_parameter
method descriptor
¶
get_string_parameter(self, arg: str, /) -> str
set_boolean_parameter
method descriptor
¶
set_boolean_parameter(self, arg0: str, arg1: bool, /) -> None
set_integer_parameter
method descriptor
¶
set_integer_parameter(self, arg0: str, arg1: int, /) -> None
set_lossy_quality
method descriptor
¶
set_lossy_quality(self, arg: int, /) -> None
set_parameter
method descriptor
¶
set_parameter(self, arg0: str, arg1: str, /) -> None
set_parameters
method descriptor
¶
set_parameters(self, params: collections.abc.Mapping[str, str]) -> None
set_string_parameter
method descriptor
¶
set_string_parameter(self, arg0: str, arg1: str, /) -> None
HeifEncoderDescriptor¶
pylibheif.HeifEncoderDescriptor ¶
Initialize self. See help(type(self)) for accurate signature.
__module__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
compression_format
property
¶
(self) -> pylibheif._pylibheif.HeifCompressionFormat
__new__
builtin
¶
Create and return a new object. See help(type) for accurate signature.
HeifEncodingOptions¶
pylibheif.HeifEncodingOptions ¶
init(self) -> None
__module__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
macOS_compatibility_workaround_no_nclx_profile
property
¶
(self) -> bool
preferred_chroma_downsampling_algorithm
property
¶
(self) -> pylibheif._pylibheif.HeifChromaDownsamplingAlgorithm
preferred_chroma_upsampling_algorithm
property
¶
(self) -> pylibheif._pylibheif.HeifChromaUpsamplingAlgorithm
save_two_colr_boxes_when_ICC_and_nclx_available
property
¶
(self) -> bool
__new__
builtin
¶
Create and return a new object. See help(type) for accurate signature.
HeifEncoderParametersProxy¶
pylibheif.HeifEncoderParametersProxy ¶
Proxy class providing dict-like access to HeifEncoder parameters.
__doc__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__module__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.