Pillow/src
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
..
libImaging add "new" rawmodes for 16-bit RGB data 2024-09-18 14:43:39 -05:00
PIL Merge pull request #8390 from radarhere/tiff_exif_transpose 2024-09-18 22:35:01 +03:00
thirdparty encode: Replace PyList_GetItem with PyList_GetItemRef 2024-07-08 15:42:26 +03:00
Tk [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-16 12:58:04 +00:00
_imaging.c Merge pull request #8211 from uploadcare/remove-c-flags 2024-08-02 16:10:10 +04:00
_imagingcms.c [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-16 12:58:04 +00:00
_imagingft.c Accept float stroke widths 2024-09-11 19:53:52 +10:00
_imagingmath.c [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-16 12:58:04 +00:00
_imagingmorph.c [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-16 12:58:04 +00:00
_imagingtk.c Call PyUnstable_Module_SetGIL() to indicate support of running with GIL disabled 2024-07-08 14:40:35 +03:00
_webp.c [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-08-24 11:27:43 +00:00
decode.c [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-16 12:58:04 +00:00
display.c [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-16 12:58:04 +00:00
encode.c Remove weird comments 2024-09-11 20:40:46 +10:00
map.c [pre-commit.ci] auto fixes from pre-commit.com hooks 2024-07-16 12:58:04 +00:00
outline.c update PyTypeObject slot names 2023-07-02 00:52:08 -05:00
path.c Removed unused variable 2024-09-13 23:41:47 +10:00