Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k0lb3/etcpack
cythonic integration of etcpack into Pillow
https://github.com/k0lb3/etcpack
codec cython etc etc2 pillow texture
Last synced: 2 months ago
JSON representation
cythonic integration of etcpack into Pillow
- Host: GitHub
- URL: https://github.com/k0lb3/etcpack
- Owner: K0lb3
- License: zlib
- Created: 2019-09-07T23:37:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-20T02:05:39.000Z (over 1 year ago)
- Last Synced: 2024-10-06T02:07:45.827Z (3 months ago)
- Topics: codec, cython, etc, etc2, pillow, texture
- Language: C++
- Size: 771 KB
- Stars: 2
- Watchers: 2
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# etcpack (for python)
A cython wrapper for [etcpack](https://github.com/Ericsson/ETCPACK.git) that integrates etcpack into Pillow as codec.Install via
``python setup.py install``
- Cython is required## usage example
```python
from PIL import Image
import etcpack
#needs to be imported once in the active code, so that the codec can register itselfraw_etc_image_data : bytes
mode = 'RGB'/'RGBA' # depending on the ETC mode
args = (x, ) # x depending on the ETC mode
img = Image.frombytes(mode, size, raw_etc_image_data, 'etc2', args)
```## codec table
|ETC mode | arg | mode |
|---|---|---|
| ETC1_RGB_NO_MIPMAPS | 0 | RGB |
| ETC2PACKAGE_RGB_NO_MIPMAPS | 1 | RGB |
| ETC2PACKAGE_RGBA_NO_MIPMAPS_OLD | 2 | RGBA |
| ETC2PACKAGE_RGBA_NO_MIPMAPS | 3 | RGBA |
| ETC2PACKAGE_RGBA1_NO_MIPMAPS | 4 | RGBA |
| ETC2PACKAGE_R_NO_MIPMAPS | 5 | R or A |
| ETC2PACKAGE_RG_NO_MIPMAPS | 6 | RGA |
| ETC2PACKAGE_R_SIGNED_NO_MIPMAPS | 7 | R or A |
| ETC2PACKAGE_RG_SIGNED_NO_MIPMAPS | 8 | RGA |
| ETC2PACKAGE_sRGB_NO_MIPMAPS | 9 | RGB |
| ETC2PACKAGE_sRGBA_NO_MIPMAPS | 10 | RGBA |
| ETC2PACKAGE_sRGBA1_NO_MIPMAPS | 11 | RGBA |## notes
* compression isn't implemented
* RG is untested