I try to find way for compressing images(PNG as an example) with any S3TC/DXT algorithm using python libraries.
As I can see in Pillow(PIL) library DDS format in Read-only formats
section. Therefore Pillow can't be used for this purpose.
Searching in google didn't give positive results.
Is it possible to do with python?
Could someone please provide link to libraries with such functional?(which is checked on practice)
DDS format is not mandatory for my case. I need only compressed file.
It's required for creating textures for future use.
Library should support different algorithms of compression.
答案 0 :(得分:2)
You could use Python Wand. Here I create a pseudo image with a magenta-yellow gradient and save as DDS
:
from wand.image import Image
with Image(width=200, height=80, pseudo='gradient:magenta-yellow') as img:
img.save(filename='result.dds')
Or, if you want to load a PNG file and save as DDS:
with Image(filename='input.png') as img:
img.save(filename='result.dds')