Pure python library for reading and writing jpeg format

guys! I am looking for a clean jpeg implementation for python (reading would be nice, but not necessary). I based only the TonyJPEG library port at http://mail.python.org/pipermail/image-sig/2004-November/003055.html
But the problem is that this library does not support writing.

Any ideas?

UPD: I need to modify the jpeg algorithm (starting with DCT) to create a working prototype.

UPD2:. The best solution for me was to port the Jpeg library from another language. I chose the TonyJPEG library because it is simpler than libJPEG .
If you need efficient low-level JPEG access in Python, the best option is to port something like libJPEG or try to understand how tools like PIL work.

+6
source share
2 answers

I don’t know any libraries written in 100% python, but if you just need a library to work in python, use PIL . It supports reading and writing of many different image formats, including JPEG. Really, he has to do everything that you need.

+6
source

If you want to get a fairly low level of access, you can use libjpeg via ctypes .
(NB: you did not specify your work environment)

+1
source

Source: https://habr.com/ru/post/888041/


All Articles