Giter VIP home page Giter VIP logo

texture2ddecoder's Introduction

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

License & Credits

This module itself is licensed under MIT.

The texture compression codecs themselves were derived on following sources and therefore have following licenses:

Codec License Source
ATC MIT Perfare/AssetStudio - Texture2DDecoderNative/atc.cpp
ASTC MIT Ishotihadus/mikunyan - ext/decoders/native/astc.c
BCn MIT Perfare/AssetStudio - Texture2DDecoderNative/bcn.cpp
ETC MIT Ishotihadus/mikunyan - ext/decoders/native/etc.c
f16 MIT Maratyszcza/FP16
PVRTC MIT Ishotihadus/mikunyan - ext/decoders/native/pvrtc.c
Crunch PUBLIC DOMAIN BinomialLLC/crunch
Crunch (Unity) ZLIB Unity-Technologies/crunch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.