jpeglib

Python envelope for the popular C library libjpeg for handling JPEG files.

https://github.com/martinbenes1996/jpeglib

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
Last synced: 10 months ago · JSON representation

Repository

Python envelope for the popular C library libjpeg for handling JPEG files.

Basic Info
  • Host: GitHub
  • Owner: martinbenes1996
  • License: mpl-2.0
  • Language: C
  • Default Branch: master
  • Homepage:
  • Size: 34.7 MB
Statistics
  • Stars: 32
  • Watchers: 2
  • Forks: 8
  • Open Issues: 1
  • Releases: 28
Created over 4 years ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

PyPI version Commit CI/CD Release CI/CD Documentation Status PyPI downloads Stars Contributors Wheel Status PyPi license Last commit

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 jpeglib together 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

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

All Time
  • Total Commits: 719
  • Total Committers: 9
  • Avg Commits per committer: 79.889
  • Development Distribution Score (DDS): 0.463
Past Year
  • Commits: 163
  • Committers: 7
  • Avg Commits per committer: 23.286
  • Development Distribution Score (DDS): 0.344
Top Committers
Name Email 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
bug (6) good first issue (6) enhancement (4) documentation (1) wontfix (1)
Pull Request Labels
good first issue (4) bug (3) enhancement (3)

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.

  • Versions: 78
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 2,153 Last month
Rankings
Downloads: 6.8%
Dependent packages count: 10.0%
Forks count: 13.3%
Average: 13.3%
Stargazers count: 14.8%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 11 months ago

Dependencies

requirements.txt pypi
  • numpy *
tests/requirements.txt pypi
  • Pillow *
  • cython *
  • pandas *
  • scipy *
  • wheel *
.github/common/install_test_dependencies/action.yml actions
  • ./.github/common/install_dependencies * composite
.github/workflows/on_commit.yml actions
  • ./.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/workflows/on_release.yml actions
  • ./.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/build_from_source/action.yml actions
.github/common/build_wheels/action.yml actions
.github/common/code_quality/action.yml actions
.github/common/install_dependencies/action.yml actions
.github/common/install_test_dependencies_windows/action.yml actions
  • ./.github/common/install_dependencies * composite
.github/common/unit_tests/action.yml actions
setup.py pypi
docs/requirements.txt pypi
  • numpy >=1.18.0
  • readthedocs-sphinx-search ==0.1.1
  • sphinx ==5.3.0
  • sphinx_rtd_theme ==1.1.1
  • wheel >0.30.0