yizhilong28 / pngquant-py

Export some handful interfaces for using pngquant in Python via cffi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pngquant-py

[WIP]

Export some handful interfaces for using pngquant in Python via cffi.

pngquant.tiny

Compress png image and reduce its size.

Usage

from pngquant import tiny

# .. get origin image's width & height

with open('origin.png', 'rb') as origin:
    rv = tiny(origin.read(), origin_img_width, origin_img_height)
    with open('compressed.png', 'wb') as compressed:
        compressed.write(rv)

TODO

  • [?] Add setup informations.
  • [?] Add some testcases.
  • [?] Clear some code todos.
  • [?] Add options for interfaces.

About

Export some handful interfaces for using pngquant in Python via cffi.


Languages

Language:C 54.0%Language:Python 46.0%