Skip to main content

That is a bridge of pngquant for python3

Project description

SmilePngquant

That is a bridge of pngquant for python3

Download

Find package

Or build from github

git clone --recursive git://github.com/kornelski/pngquant.git
cd pngquant
make
sudo make install

Find

which pngquant

$ /usr/local/bin/pngquant

Check version

pngquant --version

$ 2.17.0 (September 2021)

Start to code

from SmilePNGQuant import SmilePNGQuant

# initialize
smile = SmilePNGQuant()

# test a filename
# quality value starts 20 to 100, and it's integer
smile.compress(
  filename  = '/home/thyda/Download/kara.png'
  , quality = 80
)

# verify before use
if smile.isError():
  print(f'Everything is okay, the file name is: {smile.getFilename()}')

else:
  print(f'{smile.getErrorMessage()}')

It is available on PyPi store via https://pypi.org/project/SmilePngquant/
To Support my work, please donate me via Buy me a PizzaBuy me a Coffee

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

smilepngquant-0.0.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

smilepngquant-0.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

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