Skip to main content

a python wrapper for Perfare's Texture2DDecoder

Project description

texture2ddecoder

PyPI supported Python versions Win/Mac/Linux MIT Build Status Build Status (Github)

A python wrapper for Perfare's Texture2DDecoder

Some changes were made to the original code to make it cross-platform compatible.

  1. Installation
  2. Example
  3. Functions

Installation

pip install texture2ddecoder

or download/clone the git and use

python setup.py install

Example

import texture2ddecoder

# load sample data
data = open("astc_sample", "rb").read()

# decode data
width = 512
height = 512
block_width = block_height = 4

decoded_data= texture2ddecoder.decode_astc(data, width, height, block_width, block_height)

# load raw image data
dec_img = Image.frombytes("RGBA", (width, height), decoded_data, 'raw', ("BGRA"))

Functions

  • All functions accept only arguments, no keywords.
  • decode_pvrtc can cause segfaults on Mac OS

decode_bc1

decompresses bc1 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_bc3

decompresses bc3 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_pvrtc

decompresses pvrtc textures to BGRA

Params: bytes data, long width, long height, bool is2bpp Return: bytes

decode_etc1

decompresses etc1 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_etc2

decompresses etc2 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_etc2a1

decompresses etc2a1 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_etc2a8

decompresses etc2a8 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_eacr

decompresses eacr textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_eacr_signed

decompresses eacr_signed textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_eacrg

decompresses eacrg textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_eacrg_signed

decompresses eacrg_signed textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_bc4

decompresses bc4 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_bc5

decompresses bc5 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_bc6

decompresses bc6 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_bc7

decompresses bc7 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_atc_rgb4

decompresses atc_rgb4 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_atc_rgba8

decompresses atc_rgba8 textures to BGRA

Params: bytes data, long width, long height Return: bytes

decode_astc

decompresses astc textures to BGRA

Params: bytes data, long width, long height, int block_width, int block_height Return: bytes

unpack_crunch

decompresses crunch textures to BGRA

Params: bytes data Return: bytes

unpack_unity_crunch

decompresses unity_crunch textures to BGRA

Params: bytes data Return: bytes

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

texture2ddecoder-1.0.4.tar.gz (101.2 kB view hashes)

Uploaded Source

Built Distributions

texture2ddecoder-1.0.4-py3.10-win-amd64.egg (60.2 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-py3.10-win32.egg (50.9 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-py3.9-win-amd64.egg (60.2 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-py3.9-win32.egg (50.9 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-py3.8-win-amd64.egg (60.2 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-py3.8-win32.egg (50.9 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-py3.7-win-amd64.egg (60.2 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-py3.7-win32.egg (50.9 kB view hashes)

Uploaded Source

texture2ddecoder-1.0.4-cp312-cp312-win_amd64.whl (59.2 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

texture2ddecoder-1.0.4-cp312-cp312-win32.whl (50.1 kB view hashes)

Uploaded CPython 3.12 Windows x86

texture2ddecoder-1.0.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (377.3 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

texture2ddecoder-1.0.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (363.3 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

texture2ddecoder-1.0.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (363.8 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

texture2ddecoder-1.0.4-cp312-cp312-macosx_11_0_arm64.whl (80.4 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

texture2ddecoder-1.0.4-cp312-cp312-macosx_10_9_x86_64.whl (88.7 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

texture2ddecoder-1.0.4-cp312-cp312-macosx_10_9_universal2.whl (166.3 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

texture2ddecoder-1.0.4-cp311-cp311-win_amd64.whl (59.2 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

texture2ddecoder-1.0.4-cp311-cp311-win32.whl (50.0 kB view hashes)

Uploaded CPython 3.11 Windows x86

texture2ddecoder-1.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (377.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

texture2ddecoder-1.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (363.0 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

texture2ddecoder-1.0.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (363.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

texture2ddecoder-1.0.4-cp311-cp311-macosx_11_0_arm64.whl (80.4 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

texture2ddecoder-1.0.4-cp311-cp311-macosx_10_9_x86_64.whl (88.7 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

texture2ddecoder-1.0.4-cp311-cp311-macosx_10_9_universal2.whl (166.3 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

texture2ddecoder-1.0.4-cp310-cp310-win_amd64.whl (60.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

texture2ddecoder-1.0.4-cp310-cp310-win32.whl (50.8 kB view hashes)

Uploaded CPython 3.10 Windows x86

texture2ddecoder-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (377.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

texture2ddecoder-1.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (363.0 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

texture2ddecoder-1.0.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (363.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

texture2ddecoder-1.0.4-cp310-cp310-macosx_11_0_arm64.whl (80.4 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

texture2ddecoder-1.0.4-cp310-cp310-macosx_10_15_x86_64.whl (87.5 kB view hashes)

Uploaded CPython 3.10 macOS 10.15+ x86-64

texture2ddecoder-1.0.4-cp310-cp310-macosx_10_9_x86_64.whl (88.7 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

texture2ddecoder-1.0.4-cp310-cp310-macosx_10_9_universal2.whl (166.3 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

texture2ddecoder-1.0.4-cp39-cp39-win_amd64.whl (60.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

texture2ddecoder-1.0.4-cp39-cp39-win32.whl (50.8 kB view hashes)

Uploaded CPython 3.9 Windows x86

texture2ddecoder-1.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (377.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

texture2ddecoder-1.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (362.8 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

texture2ddecoder-1.0.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (363.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

texture2ddecoder-1.0.4-cp39-cp39-macosx_11_0_arm64.whl (80.4 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

texture2ddecoder-1.0.4-cp39-cp39-macosx_10_15_x86_64.whl (87.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

texture2ddecoder-1.0.4-cp39-cp39-macosx_10_9_x86_64.whl (88.7 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

texture2ddecoder-1.0.4-cp39-cp39-macosx_10_9_universal2.whl (166.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

texture2ddecoder-1.0.4-cp38-cp38-win_amd64.whl (60.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

texture2ddecoder-1.0.4-cp38-cp38-win32.whl (50.8 kB view hashes)

Uploaded CPython 3.8 Windows x86

texture2ddecoder-1.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (371.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

texture2ddecoder-1.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (356.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

texture2ddecoder-1.0.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (357.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

texture2ddecoder-1.0.4-cp38-cp38-macosx_11_0_arm64.whl (80.4 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

texture2ddecoder-1.0.4-cp38-cp38-macosx_10_14_x86_64.whl (87.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

texture2ddecoder-1.0.4-cp38-cp38-macosx_10_9_x86_64.whl (88.7 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

texture2ddecoder-1.0.4-cp38-cp38-macosx_10_9_universal2.whl (166.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

texture2ddecoder-1.0.4-cp37-cp37m-win_amd64.whl (60.1 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

texture2ddecoder-1.0.4-cp37-cp37m-win32.whl (50.8 kB view hashes)

Uploaded CPython 3.7m Windows x86

texture2ddecoder-1.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (371.3 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

texture2ddecoder-1.0.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (356.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

texture2ddecoder-1.0.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (356.9 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

texture2ddecoder-1.0.4-cp37-cp37m-macosx_10_14_x86_64.whl (87.3 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

texture2ddecoder-1.0.4-cp37-cp37m-macosx_10_9_x86_64.whl (88.7 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

texture2ddecoder-1.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (371.3 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

texture2ddecoder-1.0.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (356.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

texture2ddecoder-1.0.4-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (356.9 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

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