All notable changes to this project will be documented in this file.
- Allow specifying encoder parameters for non-primary images in image sequence. #313
- Libheif updated from
1.18.2
to1.19.5
version. #312 - For macOS(
x86_64
), the minimum supported version for binary wheels has been raised from12
to13
.
- Error
argument '-Ofast' is deprecated
when building from source. #305
- Initial support for parsing auxiliary images. #297 Thanks to @johncf
- Libheif updated from
1.18.1
to1.18.2
version. #278 - Dropped
Python 3.8
support. #293
- More accurate error handling in the
C
module. #298 Thanks to @johncf - Support for
Pillow
11.0.0 #294
image.info["heif"]
dictionary withcamera_intrinsic_matrix
HEIF specific metadata. Currently only reading is supported. #271
- libheif updated from
1.17.6
to1.18.1
version. #249 - Python
3.13.0b3
wheels added; macOS arm64 Python3.8 wheels dropped. #272
- Support for
Pillow
10.4.0 #254
- Minimum supported Pillow version raised to
10.1.0
. #251 xmp
ininfo
dictionary is now not present if it is empty. #254
- Processing of the images in
P
mode withtransparency
= 0. #238
This release contains breaking change for monochrome images.
- Monochrome images without alpha channel, will be opened in
L
orI;16
mode instead ofRGB
. #215
convert_hdr_to_8bit
value now ignoresmonochrome
images. #215subsampling
parameter for encoding has higher priority thanchroma
. #213- Minimum required
libehif
version is1.17.0
. #214 - Minimum supported Pillow version raised to
9.5.0
. #216
libheif_info
function: addedencoders
anddecoders
keys to the result, for future libheif plugins support. #189options.PREFERRED_ENCODER
- to useencoder
different from the default one. #192options.PREFERRED_DECODER
- to usedecoder
different from the default one. #193
- Synonym for
chroma
encoder parameter:subsampling
(usage is the same as in Pillow JPEG). #161 #165 - Passing
image_orientation
value to libheif, instead of manually rotating image according to EXIF before encoding. #168 - Pillow plugin: support for images in
YCbCr
mode for saving without converting toRGB
. #169 - Pi-Heif: Python3.12 32-bit
armv7
wheels. #160
- Increased the minimum required libheif version to
1.14.1
. - Linux: When building from source,
libheif
and other libraries are no longer try built automatically. #158 - Libheif updated from
1.16.2
to1.17.5
version. #166 #175 NCLX
color profile - was reworked, updated docs, see PR for more info. #171- Minimum supported Pillow version raised to
9.2.0
. - Pi-Heif: As last libheif version requires minimum
cmake>=3.16.3
dropped Debian10 armv7
wheels. #160 - libde265 updated from
1.0.12
to1.0.14
. changelog
- Support of libheif
1.17.x
. #156 - Windows : Build from source with MinGW Python. #178
- Returned
PyPy 3.8
wheels.
- Linux:
libaom
updated to3.6.1
,musllinux
builds switched tomusllinux_1_2
tag.
- When building from source, the installer additionally searches for
libheif
usingpkg-config
. #128
Python 3.12
,PyPy 3.10
wheels.Depth Image
read support, they are available as a list inim.info["depth_images"]
#116options.SAVE_NCLX_PROFILE
- defaultFalse
to be full compatible with previous versions, but in next versions may be changed toTrue
. #118 Thanks to @wiggin15- Support for
Pillow 10.1.0
- The license for the project itself has been changed to "BSD-3-Clause" since "Apache 2.0" is not compatible with the "x265" encoder. #111 Thanks to @mattip
- Minimum required
Pillow
version increased from8.4.0
to9.1.1
- Dropped
Python 3.7
support,PyPy 3.8
wheels. - Dropped 32-bit wheels for
Pillow-Heif
.Pi-Heif
still have 32-bit wheels.
This release is fully compatible with previous versions.
- (Heif) restored lost ability after
0.9.x
versions to open HDR images in 10/12 bit. #96
libde265
(HEIF decoder) updated from 1.0.11 to 1.0.12 version. changeloglibheif
updated to1.16.2
.
- Building from source when using
apt-repository ppa:strukturag/libheif
- (Heif)
encode
function withstride
argument correctly saves image. - (Heif) HeifFile class created with
from_bytes
function withstride
argument respectstride
value during save. - (Heif) HeifFile class created with
from_bytes
function withstride
argument can correctly translate to the numpy array.
This release is fully compatible with 0.10.x
versions.
- Revert EXIF changes from
0.11.0
- raw data again can begin withExif\x00\x00
. Thanks to @fabbaum #93 - (Heif)
deepcopy
support for HeifFile class.
- EXIF raw data in info["exif"] is now skipping first 6 bytes(
Exif\x00\x00
). Like in Pillow for WEBP.
- EXIF parsing(Xiaomi images and possible others). Thanks to @mxsleo #92
- (Pillow)
deepcopy
support for HeifImageFile and AvifImageFile - (macOS, arm64)
libde265
(HEIF decoder) now has the same version as in other builds(1.0.8
->1.0.11
) - (macOS, arm64)
libaom
(AVIF) now has the same version as in other builds(3.4.0
->3.6.0
)
- Windows PyPy wheels.
- Faster image loading implementation with Pillow
9.5.0
options.ALLOW_INCORRECT_HEADERS
option to allow loading files with invalidispe
header. Thanks to @Soooda #86
libheif
updated from1.14.2
to1.15.2
Reworked version with the native C extension.
- Restored ability to build from source with libheif==1.12.0
- Ability to encode images in
LA
mode
libde265
(HEIF decoder) updated from 1.0.9 to 1.0.11 version. changelog- (Heif)
convert_to
method was removed,bgr_mode
opt. parameter added toopen_heif
- Many other changes, mostly for standalone usage. topic
- Fixed Access Violation(all versions were affected) when image size after decoding differs. #79
Two bugs in XMP metadata handling that were causing exceptions. All versions were affected. Thanks to @eeyrw for pointing out such a problem.
- Handling XMP data with
zero
byte at the end. #69 - Handling XMP data in
latin1
encoding. #69
- libheif updated from
1.14.0
to1.14.2
- info["nclx_profile"] changed the type from bytes(format of which was not described) to dict.
- Drop support for Python 3.6, PyPy 3.7. Added PyPy 3.9 wheels.
convert_to
method:RGBa
toRGB
mode support was removed(last Pillow supports it). #67
- Small memory leak when opening image with
nclx
color profile. #64
- Minimum supported version of
libheif
to build from source is1.13.0
- Minimum required
Pillow
version increased from6.2.0
to8.3.0
,getxmp
is used from Pillow now. #55 options()
was reworked. Added newDECODE_THREADS
option. #57
- Added ability to
save
method to acceptexif
asPIL.Image.Exif
class. #51 - Linux, Windows: fixed disabled multithreading for image decode. Added tests for this. Thanks to @jtressle #53
- Linux: building from source has been reworked to no longer require
autoconf
,automake
andpkg-config
.
- Armv7: wheels for Alpine 3.14+ with
musllinux_1_2_armv7l
tag.
libheif
updated to1.14.0
version- Ability to pass
enc_params
for save asList[Tuple[str, str]]
was removed, now it accepts onlyDict
. - Deprecated
options().ctx_in_memory
was removed(default behaviour does not change). - Deprecated
options().strict
was removed(default behaviour does not change). - Deprecated
check
,open
,read
,check_heif
functions was removed. scale
method marked as deprecated. Will be removed in0.9.0
version.
- Values in
enc_params
forsave
can now be of typeint
orfloat
and will be automatically converted tostr
. - Armv7: wheels supports Debian 10(was only Debian 11+\Ubuntu 20.04+ previously) with
manylinux_2_28_armv7l
tag. - Armv7: wheels sizes decreased significantly(almost in
3x
).
- (HeifImagePlugin) register proper
mimetype
forHEIF
format. #47 - (HeifImagePlugin) decode image even when
EXIF
data is corrupted. #48 - (HeifImagePlugin) correct processing of
EXIF
that do not start withb'EXIF'
(Pillow9.3.0
). #46
- Support for images with a
premultiplied alpha
channel (Pillow does not fully support these). - (Heif)
premultiplied_alpha
read-write property. - (Heif)
to_pillow
method toHeifFile
class. - (Heif)
RGBA;16
->RGBA
conversion. - (Heif)
RGBa
->RGB
conversion.
libaom
updated from3.4.0
to3.5.0
version. changeloglibde265
updated from1.0.8
to1.0.9
.- (Heif) The
get_file_mimetype
function has been reworked and is now written in python. - (Heif) The
is_supported
function has been reworked and is now written in python. options().strict
option marked as deprecated and will be removed in0.8.0
.- (Heif)
check_heif
function marked as deprecated.
- (Heif)
convert_to
should do nothing if the targetmode
is already the current image mode. - (AvifImagePlugin) do not register or accept
.avifs
files, libheif does not support them. - Images in
CMYK
mode will be converted forRGBA
mode during saving instead of throwingKeyError
exception.
This release is fully compatible with previous versions.
libheif
updated to version1.13.0
- License for project itself changed to
Apache 2.0
This release contains security and bug fixes.
- Speed boost for AVIF encoding(+50%). commit
- (Linux, Windows) libde265: CVE-2022-1253, CVE-2021-36408, CVE-2021-36410, CVE-2021-35452, CVE-2021-36411 MSYS2 PR
- libheif: with chroma=
420
(which is a default mode) encoded images are closer to the originals with arrived patches. libheif issue - libheif: scaling of images in some cases: commit
- Total
21
patches with fixes from official libheif repo has arrived.
This release is fully compatible with previous versions if was not using AVIF
decoding before.
- (Heif)
save
method accepts optional parameterformat
. Ifformat="AVIF"
output file will be encoded inh264
format usingAOM
. AvifImagePlugin
introduced. Usage:register_avif_opener()
orimport pillow_heif.AvifImagePlugin
- After registering
AvifImagePlugin
you can work with.avif
files the same way you do with.heic
- (HeifImagePlugin) By default not accepts
.avif
files, registerAvifImagePlugin
if you need that. If you usepillow_avif
then do not =) options().hevc_enc
property was removed.options().avif
property was removed.
- Better compatibility with
pillow_avif
package. - (Linux) Wheels size decreased significantly(almost in
2x
). - (Linux) Building from source is a bit simpler, you can build it with your custom libraries from now.
- (Linux) Great speed boost for encoding with new build type(it is as fast now as in Windows builds).
This release is fully compatible with 0.5.0
version.
chroma=4xx
optional subsampling parameter forsave
. Equivalent toenc_params=[("chroma", "4xx")]
in old versions.
enc_params
forsave
changed type fromList[Tuple[str, str]]
toDict
. Old code will still work, but marked as deprecated.libheif_info
now returns also bundled versions ofx265
andaom
.options().avif
marked as deprecated. Starting from0.6.0
version to register anAVIF
plugin there will be a separate function, and it will be disabled by default.options().hevc_enc
marked as deprecated and will be removed in0.6.0
.
- Rare situation when exif orientation is
1
and xmp orientation different from1
present at same time. - XMP tags orientation that is generated by
exiftool
in some cases. - Updated
libaom
on Linux and Windows from3.3.0
to3.4.0
version. MacOS builds had already that version in0.5.0
. - Pillow plugin now does not register
save
methods forHEIF
format if build does not containHEIF
encoder(for custom build from source). - Slight speed optimizations for working in a
Pillow
plugin mode.
Thumbnails were reworked, if was not use them before, then this release is fully compatible with 0.4.0
version.
It is a final API release, no more further changes to existing API are planned, only bugfixes, etc.
- (Heif, HeifImagePlugin)
thumbnail
function,docs
for it. __numpy_array__
property toHeifFile
convert_to
method toHeifFile
- Wheels now are in ABI3 format for CPython(
cp3x-abi3-xxx.whl
),3x
less size on PyPi. - (Heif)
to_pillow
method, now fillsmetadata
from an original image if was called for thumbnails. - (HeifImagePlugin) During
open
current frame
in multi frame images are set to index ofPrimary Image
. - (Heif)
add_thumbnails
method moved fromHeifFile
/HeifImage
to separate file and now can accept aPIL Image
.
- (HeifImagePlugin) Nice
speed up
for reading images having thumbnails in aPillow plugin
mode. - (HeifImagePlugin)
XMP
metadata save fromTIFF
andJPEG
. - (HeifImagePlugin)
EXIF
metadata save fromTIFF
(only for Pillow >= 9.2). - (HeifImagePlugin) Not to change the index of a current frame during saving multi-frame images.
- (Heif) - Numpy array interface support.
- (Heif) -
add_from_bytes
method andfrom_bytes
function added. Allows to read 16-bit color images withOpenCV
(or any other library) and save it as 10(12) bit HEIF. - (Heif) -
convert_to
method toHeifImage
to provide an easy way to open 10 or 12 bit images as 16 bit forOpenCV
(or any other library) - (Heif, HeifImagePlugin) - support for saving images from
I
,I;16
,BGRA;16
,BGR;16
,BGRA
,BGR
modes. - (Heif) - added
save_to_12bit
tooptions
, defaultFalse
. Determines what bitness will have converted 16-bit images during saving.
- IMPORTANT!!!
10/12
bit images changed their byte order fromBig Endian
toLittle Endian
. Probably no one still uses that API, but who knows... - (Heif) -
HeifFile.chroma
andHeifFile.color
properties was removed(they were not documented so probably no one will notice this), that info now stored inmode
. - (Heif, HeifImagePlugin) -
mode
for10
/12
bits was changed and accepts wider range of values, look here - Docs were
updated
&rewritten
to reflect all those changes.
Examples
werefixed
&rewritten
(were broken from0.3.1
+ versions).exif
loading in HEIF sequence forPillow 9.2+
(python-pillow/Pillow#6335)
- Support of saving images with mode=
"1"
in"L"
mode. - Images with mode=
"L"
are now saved natively inMonochrome
mode(increase speed & decreased required memory and a bit less size) - Speed optimization for
save
append_images
parameter - Possible
SEGFAULT
during encoding with somestride
values.
- (Heif) -
HeifFile
getsimages: List[HeifImage]
and alternative method of changing order of images by editing it. - (HeifImagePlugin) -
info
image dictionary can be now edited in place, and it will be saved for image sequences.
- Updated docs.
- (HeifImagePlugin) Again fixing image order, for Pillow plugin it was not fixed fully in 0.3.0.
- Optimizing code.
- (HeifImagePlugin, Heif) -
save
now recognizesexif=
andxmp=
optional parameters. Works as in other Pillow plugins. #25 - (HeifImagePlugin, Heif) -
save
now recognizesprimary_index
optional parameter. - (HeifImagePlugin, Heif) -
info["primary"]
value. - (Heif) -
primary_index
method toHeifFile
class. - Docs: Encoding
- Docs: Changes in Order Of Images
- Changed image order when multiply images present,
HeifFile
points to primary image as it was before, but it can be not the first image in a list. - When using as a Pillow's plugin the only way to know is an image
Primary
or not is to perform check ofinfo["primary"]
value. - (Heif) - optimized code of
HeifImageThumbnail
, addedget_original
method.
- (HeifImagePlugin) -
save
bug, when first frame was saved instead of current. - Minor usage fixes and optimizations.
- (HeifImagePlugin) - support for
PIL.ImageFile.LOAD_TRUNCATED_IMAGES
flag. - (Windows, encoder) - encoding of
10
and12
bit images. #24
- (Windows) - replaced
vcpkg
build byMSYS2
(MinGW) build, report of any possible bugs you see.
- (HeifImagePlugin) - saving of XMP tags from PNG.
- Benchmarks page to docs.
- Added option
ctx_in_memory
, default=True. Benchmarks showed that versions0.1.x
which worked like that, was much faster. This will not affect any user code, changes are internal.
- (HeifImagePlugin) - XMP Orientation tag.
- (HeifImagePlugin, encoder) L and LA color modes. #23 (@Jarikf)
- Documentation has arrived.
- (HeifImagePlugin) -
custom_mimetype
field added like in other Pillow's plugins, instead ofinfo["brand"]
- (Heif) -
mimetype
field added toHeifFile
class, instead ofinfo["brand"]
- (Heif) -
apply_transformations
parameter in functionopen_heif
was removed. - (HeifImagePlugin, Heif) - removed
brand
andmain
values frominfo
dictionary. - (Heif) - added
original_bit_depth
property. It will not break any existing code. See docs. - (Heif) - function
reset_orientation
was renamed toset_orientation
.
- (HeifImagePlugin, Heif) - fix
exif
rotation, when converting from nonheif
toheif
. See in docs chapter:Workarounds
- (HeifImagePlugin, Heif) - allow saving empty HeifFile when
append_images
parameter present. - (HeifImagePlugin, Heif) - during saving,
fp
will be open after encoding process finished, and not before start. - (Heif) -
HeifImage.chroma
andHeifImage.color
property now available before the image load, right afteropen
.
- PyPy 3.9 wheels.
- (HeifImagePlugin, Heif)
append_images
parameter tosave
methods. - (HeifImagePlugin) -
import pillow_heif.HeifImagePlugin
for automatic Pillow plugin registration(as alternative to callingregister_heif_opener
). - (HeifImagePlugin, Heif)
quality
can be now-1
which indicates a lossless encoding. - (HeifImagePlugin) -
getxmp
method. Works the same way as in Pillow'sPngImagePlugin
|JpegImagePlugin
. - (Heif) - added raw
xml
asinfo["xml"]
and public functionpillow_heif.getxmp
(the same as forHeifImagePlugin
)
- (HeifImagePlugin, Heif) -
Memory Leak
whenOpening
images, that appear in version 0.2.0 wasSlain Like a Hydra
(C) - (HeifImagePlugin) - closing exclusive
fp
, this bug was only in 0.2.0+ versions. - (HeifImagePlugin, Heif) - rare Python crash, with specific
strides
of thumbnails. More tests for that. - (HeifImagePlugin, Heif) - Python crash when HeifFile closes its HeifImages when they are still referenced.
- (Windows) Build script by default assumes that
libheif
installed inC:\vcpkg\installed\x64-windows
, ifVCPKG_PREFIX
environment is missing. - (Heif)
reader_add_thumbnail
andreader_remove_image
examples. - (Heif)
to_pillow
method and adjusted examples to use it.
- (Heif) Removed
HeifSaveMask
,get_img_thumb_mask_for_save
that was previously introduced, instead added__delitem__
toHeifFile
. - Thumbnail encoding features reworked to simplify api. See
add_thumbnails
methods inHeifFile
andHeifImage
classes.
- (HeifImagePlugin) Fixed palette images with bytes transparency conversion. #21 (@Jarikf)
- (Heif) Raises
ValueError
when trying to save empty(no images) file. - (HeifImagePlugin) Skips images with sizes =
0
during save, if there are no images, raiseValueError
. - (HeifImagePlugin) Memory optimizations, when there is only one image in file.
- Added licenses for libraries in binary wheels.
- (Windows) Fix docs for building and developing.
- (Heif)
add_from_pillow
method, now adds thumbnails from Pillow if it isHeifImageFile(ImageFile.ImageFile)
class.
- encoding of images and thumbnails.
save
andsave_all
methods for Pillow plugin.save
method forHeifFile
class.from_pillow
method, to initHeifFile
class from Pillow.add_heif
method forHeifFile
class, to concatenate two heic files.- more examples.
read_heif
in process of deprecation. When you readdata
orstride
properties image will be loaded automatically.Undecoded*
classes was removed.- Input files are now not read to memory, they will be read them from
fp
object only when need something. You can use oldload
andclose(fp_only=true)
to read it formfp
and close it. - thumbnails are enabled by default.
- many other minor changes.
- in future there will be fewer changes to api, this project goes to
stable
version from now.
- Speed and memory optimisations.
- Linux aarch64 PyPy 3.7 & 3.8 wheels.
- wrapper for libheif function
get_file_mimetype
. burst
(container) image support(ImageSequence
) forheic
andhif
when using as a pillow plugin.- convert to jpg example for both
reader
andplugin
use. - in addition to iterator, to loop throw all images,
(Undecoded)``HeifFile
class now support access images by index.
heif_brand_*
constants was removed, as mentioned in changes for 0.1.9 version.
- memory leak when working with thumbnails, now properly releases the thumbnail handle.
- rare bug with garbage collector for PyPy.
as_opener
registerimage/heic
mimetype in addition toimage/heif
.as_opener
also registers.heif
extension, thanks @dust-to-dust for pointing that.as_opener
setsorientation
tag to1
fromExif
to not rotate image twice(libheif
already do transforms)- for
reader
you can do that manually if needed, with newreset_orientation
function.
- macOS Intel PyPy3.7 & PyPy3.8 v7.3 wheels.
- class
HeifCompressionFormat(IntEnum)
.have_decoder_for_format
andhave_encoder_for_format
functions. - function
libheif_info
that returns dictionary with the version and available (en)(de)coders. - class
HeifThumbnail
for thumbnails, see in examples. Only for reader now, the next version will be for Pillow plugin as well. - top lvl images support(
burst
), see in examples. Only for reader now, the next version will be for Pillow plugin as well. - method
thumbnails_all
returning an iterator for getting thumbnails in all images inHeifFile
.
- OPTIONS["avif"] and OPTIONS["strict"] replaced with
options
function, that returnsPyLibHeifOptions
class with those properties. - if available, functions to check if image is supported
HEIF
will try to get 16 bytes instead of 12.
- Linux PyPy 3.7 & 3.8 wheels.
- IMPORTANT!
heif_filetype_*
constants will be deprecated in the future. Useclass HeifFiletype(IntEnum)
. - IMPORTANT!
heif_brand_*
constants will be deprecated in the future. Useclass HeifBrand(IntEnum)
. - Added
cfg_options
function, to change config when used not asopener
. Look at_options.py
for more info. - OPTIONS:
strict
andavif
- look atreader.is_supported
function description. class HeifErrorCode(IntEnum)
to use in custom exception handler.class HeifColorspace(IntEnum)
instead ofheif_colorspace_*
constants.class HeifChannel(IntEnum)
instead ofheif_channel_*
constants.class HeifChroma(IntEnum)
instead ofheif_chroma_*
constants.- A few examples of how to use.
register_heif_opener
optionally accepts**kwargs
as parameter, for overwriting values in config, when used asopener
.check_heif_magic
marked as deprecated. Useis_supported
function instead.check_heif
always returnHeifFiletype.NO
when there are less 12 bytes in input.- Warning(
Unssuported HEIF... trying anyway
) was removed. (Undecoded)HeifFile
andHeifImageFile
classes was slightly changed(more consistent now). See the new description in README.md.- Many other improvements and optimizations.
- When used as reader, functions
open_heif
andread_heif
raiseHeifError
exception if file is not valid or broken.
- If
color_profile
isprof
orrICC
and data empty,color_profile
will containdata
=None
instead ofcolor_profile
=None
. check_heif
,is_supported
,open_heif
andread_heif
now preserves the file pointer, if input was a file handle.
- Ability to build from source on alpine with arm 7. Thanks to @aptalca
HeifFile
close
method now frees image decoded data.- Code optimization.
- Added
manylinux2014_i686
wheels. - Integration of PEP 517 in progress, added new instructions for building from source.
- Making code cleaner, renamed cffi module from
pillow_heif.libheif
to_pillow_heif_cffi
. - libaom bumped from 3.2.0 to 3.3.0
- Fixed
AttributeError
when callingImage.verify
. Thanks @zijian-hu for reporting.
- Windows binary wheels.
- More tests to
as_opener
module. - Code coverage.
- Using code formatting: black.
- Started changing build algorithms to support PEP 517.
- Speed optimizations and adjustments to
as_opener
module. - Added
info[icc_profile]
toHeifImageFile
when use it asas_opener
. - Adjustments to
reader
module: pillow_heif.open
is in process of deprecation, still available, but you should useopen_heif
instead.pillow_heif.check
is in process of deprecation, still available, but you should usecheck_heif
instead.pillow_heif.read
is in process of deprecation, still available, but you should useread_heif
instead.
- Apple M1 binary wheels now build on Monterey 12.01 instead of 12.2.
- HeifError exception class now calls
super
to init all values.
- Apple M1 binary wheels.
- Alpine Linux binary wheels.
- More auto tests before publishing.
- libaom bumped from 2.0.0 to 3.2.0
First normal working release.
- Python 3.10 wheels.
- Added
libaom
library to linux build. - More tests.
- Code refactoring, readme update.
- Bug with header check when used as plugin for Pillow with
as_opener
function. Thanks for this to @DimonLavron