Commit Graph

415 Commits

Author SHA1 Message Date
Andrew Murray
7aa49741c6 Merge branch 'main' into getpalette 2022-02-20 23:52:20 +11:00
Andrew Murray
da451e5bea Record the version the rawmode argument was added 2022-02-19 22:55:23 +11:00
Hugo van Kemenade
de06aba8f1
Merge pull request #6068 from radarhere/quantize
Changed quantize default dither to FLOYDSTEINBERG
2022-02-19 11:24:17 +02:00
Hugo van Kemenade
e0afe932a1
Merge pull request #6057 from radarhere/mode_conv
Merged _MODE_CONV typ into ImageMode as typestr
2022-02-19 10:13:36 +02:00
Andrew Murray
7538864839 Changed quantize default dither to FLOYDSTEINBERG 2022-02-19 10:49:46 +11:00
Hugo van Kemenade
1ec7be9a87
Merge pull request #6060 from radarhere/palette
Consider palette size when converting and in getpalette()
2022-02-18 23:31:56 +02:00
Hugo van Kemenade
07741c9315
Merge pull request #5954 from radarhere/enum 2022-02-18 15:53:41 +02:00
Andrew Murray
6be87277f7 Allow rawmode None to return the palette in the current mode 2022-02-17 10:35:13 +11:00
Andrew Murray
852859476b Added rawmode argument to getpalette() 2022-02-17 10:15:03 +11:00
Andrew Murray
948c064b28 Allow getpalette() to return less than 256 colors 2022-02-16 09:56:13 +11:00
Andrew Murray
fbd23bbf28 Clarified code 2022-02-15 22:30:33 +11:00
Andrew Murray
902e3812a8 Use ternary operator 2022-02-15 22:30:33 +11:00
Andrew Murray
a2313be894 Merged _MODE_CONV typ into ImageMode as typestr 2022-02-15 18:01:02 +11:00
Andrew Murray
95c17a8334 Replaced _MODE_CONV extra with bands length 2022-02-15 17:39:56 +11:00
Andrew Murray
9cdb0508b6 Attach RGBA palettes from putpalette() when suitable 2022-02-14 20:28:47 +11:00
Andrew Murray
b38a67fa12
Merge branch 'main' into enum 2022-02-10 09:52:24 +11:00
Hugo van Kemenade
0a49ec1cc0
Merge pull request #5891 from shamrin/stable-jupyter-text-output
Keep IPython/Jupyter text/plain output stable
2022-01-23 10:29:50 +02:00
Andrew Murray
591231bbb4
Changed error wording
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-01-21 08:19:27 +11:00
Andrew Murray
af90dd773b Raise an error when performing a negative crop 2022-01-18 16:38:00 +11:00
Andrew Murray
ed8073e846 Deprecated constants in favour of enums 2022-01-15 10:07:07 +11:00
Andrew Murray
f8e4e9c2dd Added enums 2022-01-15 09:02:31 +11:00
Andrew Murray
b5160591bc Return an empty bytestring from tobytes() for an empty image 2022-01-07 16:29:38 +11:00
Hugo van Kemenade
e077229d7a Remove readonly from Image.__eq__ 2022-01-04 11:32:15 +02:00
Andrew Murray
cdb0fba2ed Removed redundant part of condition 2021-12-30 11:45:40 +11:00
Hugo van Kemenade
17ec8b5c98
Merge pull request #5879 from radarhere/quantize
Limit quantized palette to number of colors
2021-12-28 10:08:54 +02:00
Andrew Murray
020308a7be Clarified that the sequence object for putdata() should be flattened 2021-12-28 09:38:41 +11:00
Andrew Murray
0af91de452 Image.NONE is only used for resampling and dithers 2021-12-27 12:27:06 +11:00
pre-commit-ci[bot]
56d630294c [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-12-15 20:39:43 +00:00
Alexey Shamrin
b3cb55f823
keep IPython/Jupyter text/plain output stable 2021-12-15 22:35:32 +02:00
Andrew Murray
ec198899f6 Limit quantized palette to number of colors 2021-12-11 16:23:37 +11:00
Andrew Murray
cea84e6b2d Improved explanation of fromarray "mode" parameter 2021-11-23 20:35:35 +11:00
Andrew Murray
83c42fcabd Do not redeclare class each time when converting to NumPy 2021-11-20 10:13:10 +11:00
Hugo van Kemenade
36eb97d3c0
Merge branch 'main' into rm-3.6 2021-10-25 12:05:05 +03:00
Hugo van Kemenade
31a96b9c9b Upgrade Python syntax with pyupgrade --py36-plus and format with Black 2021-10-19 15:34:52 +03:00
Hugo van Kemenade
716a0baf74 Drop support for EOL Python 3.6 2021-10-19 15:34:52 +03:00
Hugo van Kemenade
6e310e3e2e Update expected Pillow 10 release date: 2023-07-01 2021-10-18 15:48:49 +03:00
Andrew Murray
83864b01cf Removed Image.show command parameter 2021-10-18 11:08:51 +11:00
Andrew Murray
499040491b Removed Image._showxv 2021-10-18 11:06:06 +11:00
Andrew Murray
cd50d468ba Removed PILLOW_VERSION 2021-10-18 11:05:53 +11:00
Andrew Murray
0dba28613b Copy Python palette to new image in quantize() 2021-08-31 00:33:10 +10:00
Hugo van Kemenade
ea4263c448
Merge pull request #5634 from radarhere/putpalette
putpalette() rawmode may be modes that can be unpacked to RGB
2021-08-13 13:19:50 +03:00
Hugo van Kemenade
3d35e5458f
Merge pull request #5606 from radarhere/convert_transparency 2021-08-13 13:18:39 +03:00
Hugo van Kemenade
afebfcb096
Merge pull request #5647 from radarhere/transform_palette 2021-08-13 13:18:00 +03:00
Hugo van Kemenade
2e5ce839ba
Merge pull request #5633 from radarhere/save_path
Corrected pathlib.Path detection when saving
2021-08-06 17:15:15 +03:00
Hugo van Kemenade
3307bf691f
Merge pull request #5594 from radarhere/convert
If default conversion from P is RGB with transparency, convert to RGBA
2021-08-06 14:08:38 +03:00
Andrew Murray
d1815377b8 Copy palette to new image in transform() 2021-07-31 22:49:16 +10:00
Andrew Murray
438c3cc097 Speed up rotating square images by 90 or 270 degrees 2021-07-30 19:57:09 +10:00
Andrew Murray
89ab20fd15 putpalette() rawmode may be modes that can be unpacked to RGB 2021-07-25 16:32:59 +10:00
Andrew Murray
4038a287ee Corrected pathlib.Path detection when saving 2021-07-24 14:21:33 +10:00
Andrew Murray
97e0cb85ee Keep transparency when converting from P to LA or PA 2021-07-12 22:55:12 +10:00
Andrew Murray
fdfa9e8521 If default conversion from P is RGB with transparency, convert to RGBA 2021-07-08 17:08:11 +10:00
Andrew Murray
9688507193 Removed variable 2021-07-05 23:02:26 +10:00
Thomas Viehmann
8d1b433c76
Use numpy.array with dtype
Thank you @radarhere.

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2021-07-01 14:08:51 +02:00
Thomas Viehmann
1c03526b65 Make Image.__array__ take optional dtype argument
This is required by the numpy protocol.
2021-07-01 13:09:40 +02:00
Andrew Murray
cab9179a85
Merge pull request #5315 from radarhere/simplified
Simplified code
2021-06-30 19:24:19 +10:00
Andrew Murray
0aa8bd00e7 Added warning if defusedxml is not found 2021-06-30 11:29:13 +10:00
Andrew Murray
d9d811ff21 Replaced xml.etree.ElementTree with defusedxml.ElementTree 2021-06-30 11:28:44 +10:00
Andrew Murray
41b58f4b16 Replaced xml.etree.ElementTree with re 2021-06-30 11:28:40 +10:00
Hugo van Kemenade
50302231ed
Merge pull request #5552 from radarhere/palette 2021-06-28 19:01:54 +03:00
Hugo van Kemenade
b5c4b9afe0
Merge pull request #5455 from radarhere/xmp 2021-06-28 18:43:04 +03:00
Hugo van Kemenade
6d94376d1f
Merge pull request #5416 from radarhere/tiff_exif
Allow getexif() to access TIFF tag_v2 data
2021-06-28 18:12:17 +03:00
Andrew Murray
1ee30ded0b Fixed reloading palette 2021-06-28 22:27:05 +10:00
Andrew Murray
6db0e96102 Ensure image is loaded in remap_palette 2021-06-28 20:12:22 +10:00
Andrew Murray
804183c248 Only use an RGBA palette for images with an alpha channel 2021-06-27 18:29:02 +10:00
Andrew Murray
450382f574 Do not use raw ImagePalette 2021-06-27 15:09:39 +10:00
Andrew Murray
59a3e3bc60 Rearranged code to limit line length 2021-06-23 19:37:56 +10:00
Andrew Murray
9192a33b38 Removed unnecessary load() 2021-06-23 19:29:02 +10:00
Andrew Murray
8210645e4b If all 256 colors are in use, then there is no need for an additional color for background or transparency 2021-06-23 19:28:46 +10:00
Andrew Murray
fa559277fb When allocating a new color, repurpose an unused index if necessary 2021-06-23 19:27:08 +10:00
Andrew Murray
4d36feefc7 Set palette to be empty by default 2021-06-23 19:22:21 +10:00
Andrew Murray
aa4489c993 Keep palette the same length 2021-06-19 09:31:46 +10:00
Andrew Murray
f45d2e296d Ensure palette string matches RGB mode 2021-06-19 09:16:05 +10:00
Andrew Murray
cd31dae0d1 Added getxmp() for PNG 2021-06-12 13:57:14 +10:00
Hugo van Kemenade
3cbf4d5ef7
Merge pull request #5379 from radarhere/numpy
Allow converting an image to a numpy array to raise errors
2021-05-20 15:09:02 +03:00
Andrew Murray
3795772187 Use python3 2021-05-08 12:37:06 +10:00
Andrew Murray
0f68e63793 Allow for sys.stdout.buffer to be missing 2021-05-03 18:07:05 +10:00
Andrew Murray
fae9afe351 Replace sys.stdout with sys.stdout.buffer when saving 2021-04-29 21:35:57 +10:00
Andrew Murray
622ba122ce Added Exif load_from_fp method to get TIFF tag_v2 data 2021-04-29 21:21:55 +10:00
Andrew Murray
7c0344bb99 For special image modes, revert default resize resampling to NEAREST 2021-04-17 12:18:42 +10:00
Andrew Murray
77a8a53a94 Allow converting an image to a numpy array to raise errors 2021-04-03 13:20:58 +11:00
Andrew Murray
2c8684c525 Moved getxmp() into JpegImageFile 2021-04-01 22:28:37 +11:00
Hugo van Kemenade
6812205f18
Merge pull request #5144 from UrielMaD/feature_xmp 2021-04-01 12:44:47 +03:00
Andrew Murray
80878fa4c6 Merge branch 'master' into modes 2021-03-31 18:58:11 +11:00
Andrew Murray
0a56d9b287
Merge branch 'master' into simplified 2021-03-29 19:37:55 +11:00
Hugo van Kemenade
e405ab300b
Merge pull request #5351 from radarhere/categories 2021-03-28 14:34:50 +03:00
Andrew Murray
f799915d6f
Merge pull request #5304 from nulano/5300
Do not premultiply alpha when resizing with Image.NEAREST resampling
2021-03-28 16:02:01 +11:00
Andrew Murray
71cd97a519 Added deprecation warnings 2021-03-28 15:51:28 +11:00
Hugo van Kemenade
5e1d304769
Merge pull request #5353 from radarhere/quantize_attributes
Use quantization method attributes
2021-03-27 20:01:49 +02:00
nulano
49fa3656b1 do not premultiply alpha when resizing with Image.NEAREST resampling 2021-03-23 13:16:20 +01:00
Andrew Murray
4e0bc3bab6 Use quantization method attributes 2021-03-22 19:44:56 +11:00
Andrew Murray
0ff9879171 Document supported quantization methods for RGBA images 2021-03-22 19:21:31 +11:00
Andrew Murray
ab56edb49f Documented default quantization method 2021-03-22 19:18:36 +11:00
Andrew Murray
36a4b055bb Updated comments 2021-03-15 12:50:30 +11:00
Andrew Murray
68719fe6ea
Merge branch 'master' into exif 2021-03-15 12:41:45 +11:00
Andrew Murray
c52b45df62 Removed automatic retrieval of GPS IFD 2021-03-15 12:33:06 +11:00
Andrew Murray
ca204ba04f Removed Image._MODEINFO 2021-03-07 14:21:27 +11:00
Andrew Murray
e437a8f981 Do not edit text of mode strings 2021-03-07 13:14:07 +11:00
Andrew Murray
8206f14419 Simplified code 2021-03-06 21:44:31 +11:00
Andrew Murray
690cf9ebe2 Allow alpha_composite destination to be negative 2021-03-06 20:54:21 +11:00
Andrew Murray
e763f8f2be Save interop IFD when converting Exif to bytes 2021-02-22 07:47:59 +11:00