Skip to content

Removed HEADER_V72 and HEADER_V73 #11

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

Open
wants to merge 10 commits into
base: vtf-support
Choose a base branch
from

Conversation

radarhere
Copy link

Suggestions for python-pillow#6487

Feel free to disagree with any of my rearranging of code.

  • Rather than always defaulting the pixel format to RGBA8888 when saving, use that for RGBA, RGB888 for RGB, I8 for L and IA88 for LA.
  • Rather than writing the thumbnail image to a BytesIO buffer to get the length before writing it, _get_texture_size() can be used to get the length.
  • Comment unused VtfPF enum values. I presume that's the pattern you were going for with the commented values.
  • Removed HEADER_V72 and HEADER_V73. It seems like duplicate code to me, so instead of packing the entire header at one, just pack the HEADER_V70 portion, and then append the rest.
  • Convert to RGBA for low-res DXT1, rather than RGB. I don't imagine there's any reason to abandon the alpha channel
  • Thumbnail does not scale up, so thumb.thumbnail((min(16, width), min(16, height))) can be simplified to thumb.thumbnail((16, 16))
  • DXT1 supports 8-bit alpha, so the CompiledVtfFlags.EIGHTBITALPHA flag can be used there as well
  • Only CompiledVtfFlags.EIGHTBITALPHA for bcn encoding if there is an alpha channel present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant