Metadata-Version: 2.1
Name: smilepngquant
Version: 0.0.6
Summary: That is a bridge of pngquant for python3
Home-page: https://github.com/sitthykun/smilepngquant
Author: Sitthykun LY
Author-email: ly.sitthykun@gmail.com
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/sitthykun/smilepngquant/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt

# SmilePngquant
That is a bridge of pngquant for python3

# Download
### Find package
- https://pkgs.org/download/pngquant
- Ex: https://ubuntu.pkgs.org/20.04/ubuntu-universe-amd64/pngquant_2.12.2-1_amd64.deb.html
- This document will cover

### Or build from github
```commandline
git clone --recursive git://github.com/kornelski/pngquant.git
cd pngquant
make
sudo make install
```

# Find
```commandline
which pngquant
```
$ /usr/local/bin/pngquant

# Check version
```commandline
pngquant --version
```
$ 2.17.0 (September 2021)

# Start to code
```
from smilepngquant.PNGQuant import PNGQuant

# initialize
smile = PNGQuant()
```
*** by default the application located in /usr/local/bin/pngquant

*** it's able to set to another location via
```
smile.setPngQuant(path= '/home/thyda/my_app')
```


# 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()}')
```

# Options
- dirname: can be None
set coy to a new directory for the new file

- newFilename: can be None
set a new copy name

Both can set any value, or None, or one of them.

Let check the example:

Ex 1
```
smile.compress(
  filename      = '/home/thyda/Download/kara.png'
  , quality     = 80
  # move to new directory
  , dirname     = '/home/thyda/Document/'
  , newFilename = 'jojo'
)
```

Ex 2
```
smile.compress(
  filename      = '/home/thyda/Download/kara.png'
  , quality     = 80
  # move to new directory
  , dirname     = '/home/thyda/Document/'
)
```

Ex 3 
```
smile.compress(
  filename      = '/home/thyda/Download/kara.png'
  , quality     = 80
  # move to new directory
  , newFilename = 'jojo'
)
```

It is also available on https://github.com/sitthykun/smilepngquant \
To Support my work, please donate me via <a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/sitthykun"><img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="Buy me a Pizza"><span style="margin-left:5px;font-size:28px !important;">Buy me a Coffee</span></a>




