jpeglib
Python envelope for the popular C library libjpeg for handling JPEG files.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
5 of 9 committers (55.6%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.4%) to scientific vocabulary
Repository
Python envelope for the popular C library libjpeg for handling JPEG files.
Basic Info
Statistics
- Stars: 32
- Watchers: 2
- Forks: 8
- Open Issues: 1
- Releases: 28
Metadata Files
README.md
jpeglib
Python envelope for the popular C library libjpeg for handling JPEG files.
libjpeg offers full control over compression and decompression and exposes DCT coefficients and quantization tables.
Installation
Simply install the package with pip3
bash
pip install jpeglib
or using the cloned repository
bash
python setup.py install
:warning: This will install
jpeglibtogether with multiple versions of libjpeg, libjpeg-turbo and mozjpeg. For common architectures/OS we provide prebuilt wheels, but installing from source takes couple of minutes.
Usage
Import the library in Python 3
python
import jpeglib
DCT
Get discrete cosine transform (DCT) coefficients and quantization matrices as numpy array
python
im = jpeglib.read_dct('input.jpeg')
im.Y; im.Cb; im.Cr; im.qt
You get luminance DCT, chrominance DCT and quantization tables.
Write the DCT coefficients back to a file with
python
im.write_dct('output.jpeg')
Pixel data
Decompress the input.jpeg into spatial representation in numpy array with
python
im = jpeglib.read_spatial('input.jpeg')
im.spatial
You can specify parameters such as output color space, DCT method, dithering, etc.
Write spatial representation in numpy arrray back to file with
python
im.write_spatial('output.jpeg')
You can specify input color space, DCT method, sampling factor, output quality, smoothing factor etc.
You can find all the details in the documentation.
libjpeg version
It is possible to choose, which version of libjpeg should be used.
python
jpeglib.version.set('6b')
Currently jpeglib supports all versions of libjpeg from 6b to 9e, libjpeg-turbo 2.1.0 and mozjpeg 4.0.3.
Their source codes is baked inside the package and thus distributed with it, avoiding external dependency.
Get currently used libjpeg version by
python
version = jpeglib.version.get()
You can also set a libjpeg version for a scope only.
python
jpeglib.version.set('6b')
im = jpeglib.read_spatial('image.jpeg') # using 6b
with jpeglib.version('9e'):
im = jpeglib.read_spatial('image.jpeg') # using 9e
im = jpeglib.read_spatial('image.jpeg') # using 6b again
Credits
Developed by Martin Benes, University of Innsbruck, 2023.
Owner
- Name: Martin Benes
- Login: martinbenes1996
- Kind: user
- Location: Innsbruck
- Repositories: 13
- Profile: https://github.com/martinbenes1996
Hi, I am machine learning engineer!
GitHub Events
Total
- Issues event: 3
- Watch event: 4
- Issue comment event: 4
- Push event: 2
- Pull request review event: 1
- Pull request event: 1
- Fork event: 1
Last Year
- Issues event: 3
- Watch event: 4
- Issue comment event: 4
- Push event: 2
- Pull request review event: 1
- Pull request event: 1
- Fork event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Martin Benes | m****s@u****t | 386 |
| Martin Benes | m****6@g****m | 293 |
| Alexander Schlögl | a****l@u****t | 15 |
| nora | n****r@u****t | 10 |
| Benedikt Lorch | b****h@u****t | 10 |
| NoraH2004 | 5****4 | 2 |
| MASSIMO EYNARD | m****d@e****r | 1 |
| Chongyun Lee | 4****3 | 1 |
| Sparks-Pion | 4****n | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 12
- Total pull requests: 9
- Average time to close issues: 13 days
- Average time to close pull requests: about 3 hours
- Total issue authors: 6
- Total pull request authors: 9
- Average comments per issue: 2.83
- Average comments per pull request: 0.44
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- btlorch (4)
- alxshine (2)
- licy183 (1)
- zzu1059 (1)
- timcowlishaw (1)
- Masstock (1)
- YUJIE47 (1)
Pull Request Authors
- btlorch (1)
- NoraH2004 (1)
- alxshine (1)
- orique-uoc (1)
- mshunshin (1)
- martinbenes1996 (1)
- licy183 (1)
- Masstock (1)
- martinsbruveris (1)
- Sparks-Pion (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 2,153 last-month
- Total dependent packages: 1
- Total dependent repositories: 1
- Total versions: 78
- Total maintainers: 1
pypi.org: jpeglib
Python envelope for the popular C library libjpeg for handling JPEG files.
- Homepage: https://pypi.org/project/jpeglib/
- Documentation: https://jpeglib.readthedocs.io/en/latest/
- License: MPL
-
Latest release: 1.0.1
published almost 2 years ago
Rankings
Maintainers (1)
Dependencies
- numpy *
- Pillow *
- cython *
- pandas *
- scipy *
- wheel *
- ./.github/common/install_dependencies * composite
- ./.github/common/build_from_source * composite
- ./.github/common/code_quality * composite
- ./.github/common/install_dependencies * composite
- ./.github/common/install_test_dependencies * composite
- ./.github/common/unit_tests * composite
- actions/checkout v2 composite
- actions/setup-python v3 composite
- actions/setup-python v2 composite
- ./.github/common/build_wheels * composite
- ./.github/common/code_quality * composite
- ./.github/common/install_dependencies * composite
- ./.github/common/install_test_dependencies * composite
- ./.github/common/unit_tests * composite
- actions/checkout v2 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v2 composite
- actions/setup-python v3 composite
- actions/upload-artifact v3 composite
- pypa/gh-action-pypi-publish v1.4.1 composite
- ./.github/common/install_dependencies * composite
- numpy >=1.18.0
- readthedocs-sphinx-search ==0.1.1
- sphinx ==5.3.0
- sphinx_rtd_theme ==1.1.1
- wheel >0.30.0