Skip to main content

ASTC decoder for PIL

Project description

ASTC_Decomp

An ASTC decoder for PIL.

The decoder uses richgel999/astc_dec to decompress the ASTC blocks.

Installation

  • Cython required

PIP

pip install astc_decomp

Manual

python setup.py install

Usage

Arguments

  • block_width: - Block width, in pixels.
  • block_height: - Block height, in pixels.
  • is_srgb: - If isSRGB is true, the spec requires the decoder to scale the LDR 8-bit endpoints to 16-bit before interpolation slightly differently, which will lead to different outputs. So be sure to set it correctly (ideally it should match whatever the encoder did). (optional arg, default : False)

PIL.Image decoder

from PIL import Image
import astc_decomp 
#needs to be imported once in the active code, so that the codec can register itself

astc_data : bytes
block_width : int
block_height : int
is_srgb : bool = False
img = Image.frombytes('RGBA', size, astc_data, 'astc', (block_width, block_height, is_srgb))

raw decoder

from astc_decomp import decompress_astc

# ASTC to RGBA
rgba_data = decompress_astc(astc_data : bytes, width : int, height : int, block_width : int, block_height : int, is_srgb : bool = False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astc_decomp-1.0.3.tar.gz (58.1 kB view hashes)

Uploaded Source

Built Distributions

astc_decomp-1.0.3-py3.9-win-amd64.egg (41.2 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.9-win32.egg (36.1 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.9-macosx-10.14-x86_64.egg (44.6 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.8-win-amd64.egg (41.8 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.8-win32.egg (36.3 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.8-macosx-10.14-x86_64.egg (45.4 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.7-win-amd64.egg (41.1 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.7-win32.egg (35.7 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.7-macosx-10.14-x86_64.egg (44.8 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.6-win-amd64.egg (41.1 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.6-win32.egg (35.6 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-py3.6-macosx-10.14-x86_64.egg (45.2 kB view hashes)

Uploaded Source

astc_decomp-1.0.3-cp39-cp39-win_amd64.whl (41.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

astc_decomp-1.0.3-cp39-cp39-win32.whl (35.9 kB view hashes)

Uploaded CPython 3.9 Windows x86

astc_decomp-1.0.3-cp39-cp39-macosx_10_14_x86_64.whl (44.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

astc_decomp-1.0.3-cp38-cp38-win_amd64.whl (41.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

astc_decomp-1.0.3-cp38-cp38-win32.whl (36.2 kB view hashes)

Uploaded CPython 3.8 Windows x86

astc_decomp-1.0.3-cp38-cp38-macosx_10_14_x86_64.whl (45.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

astc_decomp-1.0.3-cp37-cp37m-win_amd64.whl (41.1 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

astc_decomp-1.0.3-cp37-cp37m-win32.whl (35.6 kB view hashes)

Uploaded CPython 3.7m Windows x86

astc_decomp-1.0.3-cp37-cp37m-macosx_10_14_x86_64.whl (44.8 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

astc_decomp-1.0.3-cp36-cp36m-win_amd64.whl (41.0 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

astc_decomp-1.0.3-cp36-cp36m-win32.whl (35.5 kB view hashes)

Uploaded CPython 3.6m Windows x86

astc_decomp-1.0.3-cp36-cp36m-macosx_10_14_x86_64.whl (45.1 kB view hashes)

Uploaded CPython 3.6m macOS 10.14+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page