Repository navigation
Conversation
|
It's actually a more complex issue with also other still unfixed stuff.
Overall I think.....that PIL simply doesn't cut it for formats like this, As opencv now ships wheels instead of requiring some local library on Linux and Mac, |
|
Thanks for the review.
I'd keep this PR focused first. |
d3a424d to
68d6f10
Compare
| return Image.frombytes("RGBA", (width, height), image_data, "raw", "BGRA") | ||
|
|
||
|
|
||
| def _float_to_uint8(value: float) -> int: |
There was a problem hiding this comment.
Imo it might be better to do this as an array operation,
as otherwise there is a sizeable performance hit.
Might as well split it into clamping and converting to int at that point.
There was a problem hiding this comment.
I'd prefer not to add NumPy or OpenCV as a hard dependency in this bug-fix PR, since NumPy is still optional in the project and the OpenCV switch is a much larger architectural change.
So I can either:
-
Optimize this without new dependencies, using Pillow's
I;16mode plus a 64k LUT for half floats and a 32×512 LUT for RGB9e5. (~200% speedup) -
Keep this PR focused on correctness and move the performance work to a follow-up PR.
Summary
This PR fixes texture parsing of
RGBAHalfandRGB9e5Floatformat.This PR partially solves #386 .
Verification