Skip to content

Encoders & Presets API

Compression configuration, encoder parameter controls, and speed preset options.


HeifEncoder

pylibheif.HeifEncoder

HeifEncoder()

init(self, format: pylibheif._pylibheif.HeifCompressionFormat, preset: str = '') -> None init(self, descriptor: pylibheif._pylibheif.HeifEncoderDescriptor, preset: str = '') -> None

__module__ class-attribute

__module__ = 'pylibheif._pylibheif'

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'.

name property

name

(self) -> str

parameters property

parameters

Retrieve or create cached parameter proxy for a HeifEncoder instance.

__new__ builtin

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__ method descriptor

__repr__()

repr(self) -> str

apply_preset method descriptor

apply_preset()

apply_preset(self, preset: str) -> None

encode_image method descriptor

encode_image()

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()

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()

get_boolean_parameter(self, arg: str, /) -> bool

get_integer_parameter method descriptor

get_integer_parameter()

get_integer_parameter(self, arg: str, /) -> int

get_parameter method descriptor

get_parameter()

get_parameter(self, arg: str, /) -> str

get_string_parameter method descriptor

get_string_parameter()

get_string_parameter(self, arg: str, /) -> str

has_parameter method descriptor

has_parameter()

has_parameter(self, name: str) -> bool

set_boolean_parameter method descriptor

set_boolean_parameter()

set_boolean_parameter(self, arg0: str, arg1: bool, /) -> None

set_integer_parameter method descriptor

set_integer_parameter()

set_integer_parameter(self, arg0: str, arg1: int, /) -> None

set_lossless method descriptor

set_lossless()

set_lossless(self, arg: bool, /) -> None

set_lossy_quality method descriptor

set_lossy_quality()

set_lossy_quality(self, arg: int, /) -> None

set_parameter method descriptor

set_parameter()

set_parameter(self, arg0: str, arg1: str, /) -> None

set_parameters method descriptor

set_parameters()

set_parameters(self, params: collections.abc.Mapping[str, str]) -> None

set_string_parameter method descriptor

set_string_parameter()

set_string_parameter(self, arg0: str, arg1: str, /) -> None


HeifEncoderDescriptor

pylibheif.HeifEncoderDescriptor

HeifEncoderDescriptor(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

__module__ class-attribute

__module__ = 'pylibheif._pylibheif'

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

compression_format

(self) -> pylibheif._pylibheif.HeifCompressionFormat

id_name property

id_name

(self) -> str

name property

name

(self) -> str

__new__ builtin

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__ method descriptor

__repr__()

repr(self) -> str


HeifEncodingOptions

pylibheif.HeifEncodingOptions

HeifEncodingOptions()

init(self) -> None

__module__ class-attribute

__module__ = 'pylibheif._pylibheif'

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'.

image_orientation property

image_orientation

(self) -> pylibheif._pylibheif.HeifOrientation

macOS_compatibility_workaround_no_nclx_profile property

macOS_compatibility_workaround_no_nclx_profile

(self) -> bool

only_use_preferred_chroma_algorithm property

only_use_preferred_chroma_algorithm

(self) -> bool

prefer_uncC_short_form property

prefer_uncC_short_form

(self) -> bool

preferred_chroma_downsampling_algorithm property

preferred_chroma_downsampling_algorithm

(self) -> pylibheif._pylibheif.HeifChromaDownsamplingAlgorithm

preferred_chroma_upsampling_algorithm property

preferred_chroma_upsampling_algorithm

(self) -> pylibheif._pylibheif.HeifChromaUpsamplingAlgorithm

save_alpha_channel property

save_alpha_channel

(self) -> bool

save_two_colr_boxes_when_ICC_and_nclx_available property

save_two_colr_boxes_when_ICC_and_nclx_available

(self) -> bool

__new__ builtin

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__ method descriptor

__repr__()

repr(self) -> str


HeifEncoderParametersProxy

pylibheif.HeifEncoderParametersProxy

HeifEncoderParametersProxy(encoder: HeifEncoder)

Proxy class providing dict-like access to HeifEncoder parameters.

__doc__ class-attribute

__doc__ = 'Proxy class providing dict-like access to HeifEncoder parameters.'

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

__module__ = 'pylibheif._proxy'

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'.

__weakref__ property

__weakref__

list of weak references to the object