GithubHelp home page GithubHelp logo

libbpg-py's Introduction

                Copyright (c) 2014 Lee June

#1. What

This is a pure python binding via CTYPES for BPG (Better Portable Graphics, http://bellard.org/bpg/, Fabrice Bellard) Image format.

#2. Where

https://github.com/retsyo/libbpg-py

#3. How

  1. You should compile libbpg into dynamic library. To do so, a minor modified Makefile ( the original one is in libbpg-0.9.4.tar.gz from http://bellard.org/bpg/) is supplied here.

  2. libbpg.py covers all in libbpg.h, which is the base of the python binding. bpgdec.py can only decode a BPG file into PPM, and there is no PNG output currently; however bpgdec.c can write both PPM and PNG. There is no bpgenc.py till now.

#4. Bugs or future plans

  1. I only use Windows, and this binding uses 32-bit bpg.dll, which is compiled with MINGW. I don't know whether all python source files runs ok on Linux with your fresh dynamic library.

  2. Maybe there needs more 'cast' in some functions in libbpg.py.

  3. Maybe later, a PIL/Pillow plugin for I/O BPG

#5. Bug in BPG?

D:\tmp\libbpg-0.9.4\py>..\bpgenc.exe -o test.bpg -lossless test.png D:\tmp\libbpg-0.9.4\py>..\bpgdec.exe -o test_c_bpgdec.ppm test.bpg D:\tmp\libbpg-0.9.4\py>e:\msys\bin\diff.exe --binary test_c_bpgdec.ppm test_py_bpgdec.ppm However, the original test.bpg and the decoded ppm has different looks. The ppm file has some red color in it. Is this a BPG bug, or I misunderstood '-lossless' parameter?

#6. Licensing

BSD license

libbpg-py's People

Contributors

asimba avatar retsyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.