-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename 16-bit RGB rawmodes #8158
Open
Yay295
wants to merge
9
commits into
python-pillow:main
Choose a base branch
from
Yay295:16bit_rgb_rawmodes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on Sep 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 65af2ab - Browse repository at this point
Copy the full SHA 65af2abView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 75205f0 - Browse repository at this point
Copy the full SHA 75205f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for a43e1f8 - Browse repository at this point
Copy the full SHA a43e1f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b719e9 - Browse repository at this point
Copy the full SHA 8b719e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 954def2 - Browse repository at this point
Copy the full SHA 954def2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 51e5c92 - Browse repository at this point
Copy the full SHA 51e5c92View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 2c4df4e - Browse repository at this point
Copy the full SHA 2c4df4eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad7ecd4 - Browse repository at this point
Copy the full SHA ad7ecd4View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe661d5 - Browse repository at this point
Copy the full SHA fe661d5View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.