Commit Graph

18521 Commits

Author SHA1 Message Date
Yay295
ad7ecd4680 add check for deprecated rawmodes when creating an ImagePalette 2024-09-18 14:43:41 -05:00
Yay295
2c4df4efd8 don't show rawmode deprecation warning if mode is same as rawmode
The "BGR;15" and "BGR;16" modes being deprecated is separate from the "BGR;15" and "BGR;16" rawmodes being deprecated.
2024-09-18 14:43:40 -05:00
Yay295
51e5c9263d move deprecated rawmode unpack tests to test_unpack_deprecated() 2024-09-18 14:43:40 -05:00
Yay295
954def2938 deprecate old rawmodes for 16-bit RGB data 2024-09-18 14:43:40 -05:00
Yay295
8b719e9401 use new rawmodes in BMP and TGA image plugins 2024-09-18 14:43:40 -05:00
Yay295
a43e1f8118 clean up rawmode syntax comments 2024-09-18 14:43:39 -05:00
Yay295
75205f0a50 add "new" rawmodes for 16-bit RGB data
The existing 16-bit RGB rawmodes do not follow the naming convention given in Unpack.c. These new modes do follow that convention, except since these modes do not all use the same number of bits for each band, the sizes of each band are listed.

Old → New
RGB;15 → XBGR;1555
RGB;16 → BGR;565
BGR;5 → XRGB;1555
BGR;15 → XRGB;1555
BGR;16 → RGB;565
RGB;4B → XBGR;4
RGBA;4B → ABGR;4
RGBA;15 → ABGR;1555
BGRA;15 → ARGB;1555
BGRA;15Z → ARGB;1555Z

These new rawmodes also use a slightly different conversion method. The most accurate conversion from 5 to 8 bits is "round(x * 255 / 31.0)". However, that involves floating point numbers and rounding, so it's not as fast. The current method doesn't include the rounding, allowing us to also use integer instead of floating point division. This is faster, but unfortunately not roundtrippable - when converting from 5 to 8 to 5 bits not every value stays the same. The new method is roundtrippable, even faster than the current method since it uses basic bitwise operations instead of multiplication and division, and if you compare the result to what you get with rounding and floating point numbers, it is actually more accurate.
2024-09-18 14:43:39 -05:00
Yay295
65af2abd1c parametrize test_lib_pack.py 2024-09-18 14:43:39 -05:00
Hugo van Kemenade
1ee3bd1d9e
Merge pull request #8390 from radarhere/tiff_exif_transpose
Use transposed size after opening for TIFF images
2024-09-18 22:35:01 +03:00
Hugo van Kemenade
743ddc7a58
Merge pull request #8338 from yngvem/improve-error-messages 2024-09-18 18:22:04 +03:00
Andrew Murray
9adb476f37
Rearranged text 2024-09-18 23:58:23 +10:00
Andrew Murray
629f5be52e In seek(), create core image at size needed for loading 2024-09-18 22:56:29 +10:00
Hugo van Kemenade
e80cada0f6
Merge pull request #8391 from radarhere/png_decompress 2024-09-18 15:31:18 +03:00
Andrew Murray
a92dca66bd Use raw size for striped tiles 2024-09-18 21:22:59 +10:00
Andrew Murray
a859695d9a
Rearranged code
Co-authored-by: Alexander Karpinsky <homm86@gmail.com>
2024-09-18 21:17:49 +10:00
Andrew Murray
9135fd0fb2 Mention limit in error message 2024-09-18 20:56:55 +10:00
Andrew Murray
84e275d906 Loading does not change mode 2024-09-18 20:27:35 +10:00
Andrew Murray
f1e86965f6 Use transposed size after opening for TIFF images 2024-09-18 20:26:06 +10:00
Andrew Murray
08d9c89d8a
Merge pull request #8388 from python-pillow/renovate/cibuildwheel-2.x
Update dependency cibuildwheel to v2.21.1
2024-09-17 18:49:59 +10:00
renovate[bot]
75e4d5a10d
Update dependency cibuildwheel to v2.21.1 2024-09-17 06:12:03 +00:00
Hugo van Kemenade
f85c8dc345
Merge pull request #8385 from radarhere/dib_hwnd
Cast Dib handle to int
2024-09-16 19:29:12 +03:00
Andrew Murray
8a086edbe9 Cast handle to int 2024-09-16 08:23:26 +10:00
Andrew Murray
a60736381e
Merge pull request #8384 from radarhere/libjpeg_turbo
Updated libjpeg-turbo to 3.0.4
2024-09-16 07:32:26 +10:00
Andrew Murray
c01d2d0577 Updated libjpeg-turbo to 3.0.4 2024-09-15 21:57:45 +10:00
Hugo van Kemenade
b67f018c00
Merge pull request #8382 from radarhere/lint 2024-09-14 15:05:38 +03:00
Hugo van Kemenade
dacfbbdc3e
Merge pull request #8381 from radarhere/macos_python 2024-09-14 13:59:40 +03:00
Andrew Murray
88b3265a9c Lint: Run PT016 2024-09-14 20:59:02 +10:00
Andrew Murray
ad0091096f
Describe supported OS versions instead of unsupported
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-09-14 20:52:49 +10:00
Andrew Murray
10c118bb5c Added release notes for #8379 2024-09-14 19:58:57 +10:00
Hugo van Kemenade
586e6f86d7
Merge pull request #8379 from radarhere/macos_python 2024-09-14 11:01:05 +03:00
Andrew Murray
38e05731f5
Merge pull request #8378 from python-pillow/renovate/cibuildwheel-2.x
Update dependency cibuildwheel to v2.21.0
2024-09-14 13:37:53 +10:00
Andrew Murray
a3d9529f04 Updated macOS deployment target for Python >= 3.12 on Intel to 10.13 2024-09-14 11:23:09 +10:00
renovate[bot]
5713159968
Update dependency cibuildwheel to v2.21.0 2024-09-13 23:52:11 +00:00
mergify[bot]
8d2bffee11
Merge pull request #8377 from radarhere/path_unused
Removed unused ImagePath variable
2024-09-13 14:33:05 +00:00
Andrew Murray
1557f7e36f Removed unused variable 2024-09-13 23:41:47 +10:00
Hugo van Kemenade
c9eb14e104
Merge pull request #7916 from radarhere/xz 2024-09-13 16:40:41 +03:00
Hugo van Kemenade
d6199a3352
Merge pull request #8376 from radarhere/macos 2024-09-13 11:10:56 +03:00
Andrew Murray
0f67dfc380 Change macos-14 to macos-latest 2024-09-13 15:31:37 +10:00
Hugo van Kemenade
e6cf27c5a8
Merge pull request #8375 from radarhere/libpng
Updated libpng to 1.6.44
2024-09-13 07:23:07 +03:00
Hugo van Kemenade
cb2b56f337
Merge pull request #8374 from radarhere/numpy
Test NumPy with musllinux wheels
2024-09-13 07:22:32 +03:00
Andrew Murray
5d8e891387 Updated libpng to 1.6.44 2024-09-13 10:52:36 +10:00
Andrew Murray
fea929bf10 Test NumPy with musllinux wheels 2024-09-13 07:34:56 +10:00
Andrew Murray
f6d5b48662
Merge pull request #8373 from lysnikolaou/install-numpy-pypi-wheels-test
Install numpy from PyPI when testing wheels
2024-09-13 06:23:29 +10:00
Lysandros Nikolaou
1ead7791c6
Remove comment 2024-09-12 16:34:29 +03:00
Lysandros Nikolaou
c9f88890a5
Install numpy from PyPI when testing wheels 2024-09-12 14:52:24 +03:00
Hugo van Kemenade
3fd6b7c072
Merge pull request #8372 from radarhere/numpy 2024-09-12 14:47:49 +03:00
Hugo van Kemenade
b19a51b63e
Merge pull request #8371 from radarhere/wheels 2024-09-12 12:59:55 +03:00
Andrew Murray
8336852b61 Install NumPy from PyPI for free threaded job 2024-09-12 18:52:07 +10:00
Andrew Murray
fab19b0af8 Windows wheels are now grouped with the others 2024-09-12 16:57:28 +10:00
Andrew Murray
aa7dfe3a56 Update CHANGES.rst [ci skip] 2024-09-12 16:16:21 +10:00