mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 00:04:09 +03:00
Merge pull request #3521 from python-pillow/update-release-notes
Update 5.4.0 release notes
This commit is contained in:
commit
fcae1325be
|
@ -1,9 +1,29 @@
|
|||
5.4.0 (unreleased)
|
||||
5.4.0
|
||||
-----
|
||||
|
||||
API Changes
|
||||
===========
|
||||
|
||||
APNG extension to PNG plugin
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Animated Portable Network Graphics (APNG) images are not fully supported but
|
||||
can be opened via the PNG plugin to get some basic info::
|
||||
|
||||
im = Image.open("image.apng")
|
||||
print(im.mode) # "RGBA"
|
||||
print(im.size) # (245, 245)
|
||||
im.show() # Shows a single frame
|
||||
|
||||
Check for libjpeg-turbo
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can check if Pillow has been built against the libjpeg-turbo version of the
|
||||
libjpeg library::
|
||||
|
||||
from PIL import features
|
||||
features.check_feature("libjpeg_turbo") # True or False
|
||||
|
||||
Negative indexes in pixel access
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -15,6 +35,26 @@ For example, to get or set the farthest pixel in the lower right of an image::
|
|||
px[-1, -1] = (0, 0, 0)
|
||||
|
||||
|
||||
New custom TIFF tags
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
TIFF images can now be saved with custom integer, float and string TIFF tags::
|
||||
|
||||
im = Image.new("RGB", (200, 100))
|
||||
custom = {
|
||||
37000: 4,
|
||||
37001: 4.2,
|
||||
37002: "custom tag value",
|
||||
37003: u"custom tag value",
|
||||
37004: b"custom tag value",
|
||||
}
|
||||
im.save("output.tif", tiffinfo=custom)
|
||||
|
||||
im2 = Image.open("output.tif")
|
||||
print(im2.tag_v2[37000]) # 4
|
||||
print(im2.tag_v2[37002]) # "custom tag value"
|
||||
print(im2.tag_v2[37004]) # b"custom tag value"
|
||||
|
||||
Other Changes
|
||||
=============
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user