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.2to1.19.5version. #312 - For macOS(
x86_64), the minimum supported version for binary wheels has been raised from12to13.
- Error
argument '-Ofast' is deprecatedwhen building from source. #305
- Initial support for parsing auxiliary images. #297 Thanks to @johncf
- Libheif updated from
1.18.1to1.18.2version. #278 - Dropped
Python 3.8support. #293
- More accurate error handling in the
Cmodule. #298 Thanks to @johncf - Support for
Pillow11.0.0 #294
image.info["heif"]dictionary withcamera_intrinsic_matrixHEIF specific metadata. Currently only reading is supported. #271
- libheif updated from
1.17.6to1.18.1version. #249 - Python
3.13.0b3wheels added; macOS arm64 Python3.8 wheels dropped. #272
- Support for
Pillow10.4.0 #254
- Minimum supported Pillow version raised to
10.1.0. #251 xmpininfodictionary is now not present if it is empty. #254
- Processing of the images in
Pmode withtransparency= 0. #238
This release contains breaking change for monochrome images.
- Monochrome images without alpha channel, will be opened in
LorI;16mode instead ofRGB. #215
convert_hdr_to_8bitvalue now ignoresmonochromeimages. #215subsamplingparameter for encoding has higher priority thanchroma. #213- Minimum required
libehifversion is1.17.0. #214 - Minimum supported Pillow version raised to
9.5.0. #216
libheif_infofunction: addedencodersanddecoderskeys to the result, for future libheif plugins support. #189options.PREFERRED_ENCODER- to useencoderdifferent from the default one. #192options.PREFERRED_DECODER- to usedecoderdifferent from the default one. #193
- Synonym for
chromaencoder parameter:subsampling(usage is the same as in Pillow JPEG). #161 #165 - Passing
image_orientationvalue to libheif, instead of manually rotating image according to EXIF before encoding. #168 - Pillow plugin: support for images in
YCbCrmode for saving without converting toRGB. #169 - Pi-Heif: Python3.12 32-bit
armv7wheels. #160
- Increased the minimum required libheif version to
1.14.1. - Linux: When building from source,
libheifand other libraries are no longer try built automatically. #158 - Libheif updated from
1.16.2to1.17.5version. #166 #175 NCLXcolor 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.3dropped Debian10 armv7wheels. #160 - libde265 updated from
1.0.12to1.0.14. changelog
- Support of libheif
1.17.x. #156 - Windows : Build from source with MinGW Python. #178
- Returned
PyPy 3.8wheels.
- Linux:
libaomupdated to3.6.1,musllinuxbuilds switched tomusllinux_1_2tag.
- When building from source, the installer additionally searches for
libheifusingpkg-config. #128
Python 3.12,PyPy 3.10wheels.Depth Imageread support, they are available as a list inim.info["depth_images"]#116options.SAVE_NCLX_PROFILE- defaultFalseto 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
Pillowversion increased from8.4.0to9.1.1 - Dropped
Python 3.7support,PyPy 3.8wheels. - Dropped 32-bit wheels for
Pillow-Heif.Pi-Heifstill have 32-bit wheels.
This release is fully compatible with previous versions.
- (Heif) restored lost ability after
0.9.xversions to open HDR images in 10/12 bit. #96
libde265(HEIF decoder) updated from 1.0.11 to 1.0.12 version. changeloglibheifupdated to1.16.2.
- Building from source when using
apt-repository ppa:strukturag/libheif - (Heif)
encodefunction withstrideargument correctly saves image. - (Heif) HeifFile class created with
from_bytesfunction withstrideargument respectstridevalue during save. - (Heif) HeifFile class created with
from_bytesfunction withstrideargument 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)
deepcopysupport 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)
deepcopysupport 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_HEADERSoption to allow loading files with invalidispeheader. Thanks to @Soooda #86
libheifupdated from1.14.2to1.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
LAmode
libde265(HEIF decoder) updated from 1.0.9 to 1.0.11 version. changelog- (Heif)
convert_tomethod was removed,bgr_modeopt. 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
zerobyte at the end. #69 - Handling XMP data in
latin1encoding. #69
- libheif updated from
1.14.0to1.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_tomethod:RGBatoRGBmode support was removed(last Pillow supports it). #67
- Small memory leak when opening image with
nclxcolor profile. #64
- Minimum supported version of
libheifto build from source is1.13.0 - Minimum required
Pillowversion increased from6.2.0to8.3.0,getxmpis used from Pillow now. #55 options()was reworked. Added newDECODE_THREADSoption. #57
- Added ability to
savemethod to acceptexifasPIL.Image.Exifclass. #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,automakeandpkg-config.
- Armv7: wheels for Alpine 3.14+ with
musllinux_1_2_armv7ltag.
libheifupdated to1.14.0version- Ability to pass
enc_paramsfor save asList[Tuple[str, str]]was removed, now it accepts onlyDict. - Deprecated
options().ctx_in_memorywas removed(default behaviour does not change). - Deprecated
options().strictwas removed(default behaviour does not change). - Deprecated
check,open,read,check_heiffunctions was removed. scalemethod marked as deprecated. Will be removed in0.9.0version.
- Values in
enc_paramsforsavecan now be of typeintorfloatand will be automatically converted tostr. - Armv7: wheels supports Debian 10(was only Debian 11+\Ubuntu 20.04+ previously) with
manylinux_2_28_armv7ltag. - Armv7: wheels sizes decreased significantly(almost in
3x).
- (HeifImagePlugin) register proper
mimetypeforHEIFformat. #47 - (HeifImagePlugin) decode image even when
EXIFdata is corrupted. #48 - (HeifImagePlugin) correct processing of
EXIFthat do not start withb'EXIF'(Pillow9.3.0). #46
- Support for images with a
premultiplied alphachannel (Pillow does not fully support these). - (Heif)
premultiplied_alpharead-write property. - (Heif)
to_pillowmethod toHeifFileclass. - (Heif)
RGBA;16->RGBAconversion. - (Heif)
RGBa->RGBconversion.
libaomupdated from3.4.0to3.5.0version. changeloglibde265updated from1.0.8to1.0.9.- (Heif) The
get_file_mimetypefunction has been reworked and is now written in python. - (Heif) The
is_supportedfunction has been reworked and is now written in python. options().strictoption marked as deprecated and will be removed in0.8.0.- (Heif)
check_heiffunction marked as deprecated.
- (Heif)
convert_toshould do nothing if the targetmodeis already the current image mode. - (AvifImagePlugin) do not register or accept
.avifsfiles, libheif does not support them. - Images in
CMYKmode will be converted forRGBAmode during saving instead of throwingKeyErrorexception.
This release is fully compatible with previous versions.
libheifupdated 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
21patches with fixes from official libheif repo has arrived.
This release is fully compatible with previous versions if was not using AVIF decoding before.
- (Heif)
savemethod accepts optional parameterformat. Ifformat="AVIF"output file will be encoded inh264format usingAOM. AvifImagePluginintroduced. Usage:register_avif_opener()orimport pillow_heif.AvifImagePlugin- After registering
AvifImagePluginyou can work with.aviffiles the same way you do with.heic
- (HeifImagePlugin) By default not accepts
.aviffiles, registerAvifImagePluginif you need that. If you usepillow_avifthen do not =) options().hevc_encproperty was removed.options().avifproperty was removed.
- Better compatibility with
pillow_avifpackage. - (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=4xxoptional subsampling parameter forsave. Equivalent toenc_params=[("chroma", "4xx")]in old versions.
enc_paramsforsavechanged type fromList[Tuple[str, str]]toDict. Old code will still work, but marked as deprecated.libheif_infonow returns also bundled versions ofx265andaom.options().avifmarked as deprecated. Starting from0.6.0version to register anAVIFplugin there will be a separate function, and it will be disabled by default.options().hevc_encmarked as deprecated and will be removed in0.6.0.
- Rare situation when exif orientation is
1and xmp orientation different from1present at same time. - XMP tags orientation that is generated by
exiftoolin some cases. - Updated
libaomon Linux and Windows from3.3.0to3.4.0version. MacOS builds had already that version in0.5.0. - Pillow plugin now does not register
savemethods forHEIFformat if build does not containHEIFencoder(for custom build from source). - Slight speed optimizations for working in a
Pillowplugin 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)
thumbnailfunction,docsfor it. __numpy_array__property toHeifFileconvert_tomethod toHeifFile
- Wheels now are in ABI3 format for CPython(
cp3x-abi3-xxx.whl),3xless size on PyPi. - (Heif)
to_pillowmethod, now fillsmetadatafrom an original image if was called for thumbnails. - (HeifImagePlugin) During
opencurrent framein multi frame images are set to index ofPrimary Image. - (Heif)
add_thumbnailsmethod moved fromHeifFile/HeifImageto separate file and now can accept aPIL Image.
- (HeifImagePlugin) Nice
speed upfor reading images having thumbnails in aPillow pluginmode. - (HeifImagePlugin)
XMPmetadata save fromTIFFandJPEG. - (HeifImagePlugin)
EXIFmetadata 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_bytesmethod andfrom_bytesfunction added. Allows to read 16-bit color images withOpenCV(or any other library) and save it as 10(12) bit HEIF. - (Heif) -
convert_tomethod toHeifImageto 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,BGRmodes. - (Heif) - added
save_to_12bittooptions, defaultFalse. Determines what bitness will have converted 16-bit images during saving.
- IMPORTANT!!!
10/12bit images changed their byte order fromBig EndiantoLittle Endian. Probably no one still uses that API, but who knows... - (Heif) -
HeifFile.chromaandHeifFile.colorproperties was removed(they were not documented so probably no one will notice this), that info now stored inmode. - (Heif, HeifImagePlugin) -
modefor10/12bits was changed and accepts wider range of values, look here - Docs were
updated&rewrittento reflect all those changes.
Exampleswerefixed&rewritten(were broken from0.3.1+ versions).exifloading 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 inMonochromemode(increase speed & decreased required memory and a bit less size) - Speed optimization for
saveappend_imagesparameter - Possible
SEGFAULTduring encoding with somestridevalues.
- (Heif) -
HeifFilegetsimages: List[HeifImage]and alternative method of changing order of images by editing it. - (HeifImagePlugin) -
infoimage 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) -
savenow recognizesexif=andxmp=optional parameters. Works as in other Pillow plugins. #25 - (HeifImagePlugin, Heif) -
savenow recognizesprimary_indexoptional parameter. - (HeifImagePlugin, Heif) -
info["primary"]value. - (Heif) -
primary_indexmethod toHeifFileclass. - Docs: Encoding
- Docs: Changes in Order Of Images
- Changed image order when multiply images present,
HeifFilepoints 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
Primaryor not is to perform check ofinfo["primary"]value. - (Heif) - optimized code of
HeifImageThumbnail, addedget_originalmethod.
- (HeifImagePlugin) -
savebug, when first frame was saved instead of current. - Minor usage fixes and optimizations.
- (HeifImagePlugin) - support for
PIL.ImageFile.LOAD_TRUNCATED_IMAGESflag. - (Windows, encoder) - encoding of
10and12bit images. #24
- (Windows) - replaced
vcpkgbuild 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.xwhich 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_mimetypefield added like in other Pillow's plugins, instead ofinfo["brand"] - (Heif) -
mimetypefield added toHeifFileclass, instead ofinfo["brand"]
- (Heif) -
apply_transformationsparameter in functionopen_heifwas removed. - (HeifImagePlugin, Heif) - removed
brandandmainvalues frominfodictionary. - (Heif) - added
original_bit_depthproperty. It will not break any existing code. See docs. - (Heif) - function
reset_orientationwas renamed toset_orientation.
- (HeifImagePlugin, Heif) - fix
exifrotation, when converting from nonheiftoheif. See in docs chapter:Workarounds - (HeifImagePlugin, Heif) - allow saving empty HeifFile when
append_imagesparameter present. - (HeifImagePlugin, Heif) - during saving,
fpwill be open after encoding process finished, and not before start. - (Heif) -
HeifImage.chromaandHeifImage.colorproperty now available before the image load, right afteropen.
- PyPy 3.9 wheels.
- (HeifImagePlugin, Heif)
append_imagesparameter tosavemethods. - (HeifImagePlugin) -
import pillow_heif.HeifImagePluginfor automatic Pillow plugin registration(as alternative to callingregister_heif_opener). - (HeifImagePlugin, Heif)
qualitycan be now-1which indicates a lossless encoding. - (HeifImagePlugin) -
getxmpmethod. Works the same way as in Pillow'sPngImagePlugin|JpegImagePlugin. - (Heif) - added raw
xmlasinfo["xml"]and public functionpillow_heif.getxmp(the same as forHeifImagePlugin)
- (HeifImagePlugin, Heif) -
Memory LeakwhenOpeningimages, 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
stridesof 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
libheifinstalled inC:\vcpkg\installed\x64-windows, ifVCPKG_PREFIXenvironment is missing. - (Heif)
reader_add_thumbnailandreader_remove_imageexamples. - (Heif)
to_pillowmethod and adjusted examples to use it.
- (Heif) Removed
HeifSaveMask,get_img_thumb_mask_for_savethat was previously introduced, instead added__delitem__toHeifFile. - Thumbnail encoding features reworked to simplify api. See
add_thumbnailsmethods inHeifFileandHeifImageclasses.
- (HeifImagePlugin) Fixed palette images with bytes transparency conversion. #21 (@Jarikf)
- (Heif) Raises
ValueErrorwhen trying to save empty(no images) file. - (HeifImagePlugin) Skips images with sizes =
0during 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_pillowmethod, now adds thumbnails from Pillow if it isHeifImageFile(ImageFile.ImageFile)class.
- encoding of images and thumbnails.
saveandsave_allmethods for Pillow plugin.savemethod forHeifFileclass.from_pillowmethod, to initHeifFileclass from Pillow.add_heifmethod forHeifFileclass, to concatenate two heic files.- more examples.
read_heifin process of deprecation. When you readdataorstrideproperties image will be loaded automatically.Undecoded*classes was removed.- Input files are now not read to memory, they will be read them from
fpobject only when need something. You can use oldloadandclose(fp_only=true)to read it formfpand close it. - thumbnails are enabled by default.
- many other minor changes.
- in future there will be fewer changes to api, this project goes to
stableversion 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) forheicandhifwhen using as a pillow plugin.- convert to jpg example for both
readerandpluginuse. - in addition to iterator, to loop throw all images,
(Undecoded)``HeifFileclass 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_openerregisterimage/heicmimetype in addition toimage/heif.as_openeralso registers.heifextension, thanks @dust-to-dust for pointing that.as_openersetsorientationtag to1fromExifto not rotate image twice(libheifalready do transforms)- for
readeryou can do that manually if needed, with newreset_orientationfunction.
- macOS Intel PyPy3.7 & PyPy3.8 v7.3 wheels.
- class
HeifCompressionFormat(IntEnum).have_decoder_for_formatandhave_encoder_for_formatfunctions. - function
libheif_infothat returns dictionary with the version and available (en)(de)coders. - class
HeifThumbnailfor 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_allreturning an iterator for getting thumbnails in all images inHeifFile.
- OPTIONS["avif"] and OPTIONS["strict"] replaced with
optionsfunction, that returnsPyLibHeifOptionsclass with those properties. - if available, functions to check if image is supported
HEIFwill 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_optionsfunction, to change config when used not asopener. Look at_options.pyfor more info. - OPTIONS:
strictandavif- look atreader.is_supportedfunction 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_openeroptionally accepts**kwargsas parameter, for overwriting values in config, when used asopener.check_heif_magicmarked as deprecated. Useis_supportedfunction instead.check_heifalways returnHeifFiletype.NOwhen there are less 12 bytes in input.- Warning(
Unssuported HEIF... trying anyway) was removed. (Undecoded)HeifFileandHeifImageFileclasses was slightly changed(more consistent now). See the new description in README.md.- Many other improvements and optimizations.
- When used as reader, functions
open_heifandread_heifraiseHeifErrorexception if file is not valid or broken.
- If
color_profileisproforrICCand data empty,color_profilewill containdata=Noneinstead ofcolor_profile=None. check_heif,is_supported,open_heifandread_heifnow preserves the file pointer, if input was a file handle.
- Ability to build from source on alpine with arm 7. Thanks to @aptalca
HeifFileclosemethod now frees image decoded data.- Code optimization.
- Added
manylinux2014_i686wheels. - Integration of PEP 517 in progress, added new instructions for building from source.
- Making code cleaner, renamed cffi module from
pillow_heif.libheifto_pillow_heif_cffi. - libaom bumped from 3.2.0 to 3.3.0
- Fixed
AttributeErrorwhen callingImage.verify. Thanks @zijian-hu for reporting.
- Windows binary wheels.
- More tests to
as_openermodule. - Code coverage.
- Using code formatting: black.
- Started changing build algorithms to support PEP 517.
- Speed optimizations and adjustments to
as_openermodule. - Added
info[icc_profile]toHeifImageFilewhen use it asas_opener. - Adjustments to
readermodule: pillow_heif.openis in process of deprecation, still available, but you should useopen_heifinstead.pillow_heif.checkis in process of deprecation, still available, but you should usecheck_heifinstead.pillow_heif.readis in process of deprecation, still available, but you should useread_heifinstead.
- Apple M1 binary wheels now build on Monterey 12.01 instead of 12.2.
- HeifError exception class now calls
superto 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
libaomlibrary to linux build. - More tests.
- Code refactoring, readme update.
- Bug with header check when used as plugin for Pillow with
as_openerfunction. Thanks for this to @DimonLavron