Skip to main content

This repository contains a Python encoder and decoder for the JPEG file format.

The easiest way to get PyJPEG is to install from the Python Package Index:

pip install pyjpeg

Example:

import pyjpeg

reader = pyjpeg.FileReader(open('test.jpg', 'rb'))
image = pyjpeg.Image.read(reader)
print(image.components[0].samples)

samples = [
    0,   0,   0,   0,   0,   0,   0,  0,
    0,   0,   0,   255, 255, 255, 0,  0,
    0,   0,   0,   0,   255, 0,   0,  0,
    0,   0,   0,   0,   255, 0,   0,  0,
    0,   0,   255, 0,   255, 0,   0,  0,
    0,   0,   255, 0,   255, 0,   0,  0,
    0,   0,   0,   255, 0,   0,   0,  0,
    0,   0,   0,   0,   0,   0,   0,  0,
]
out_image = pyjpeg.Image(8, 8, [pyjpeg.Component(1, samples)])
writer = pyjpeg.FileWriter(open('test_out.jpg', 'wb'))
out_image.write(writer)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyjpeg-0.4.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyjpeg-0.4-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file pyjpeg-0.4.tar.gz.

File metadata

  • Download URL: pyjpeg-0.4.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyjpeg-0.4.tar.gz
Algorithm Hash digest
SHA256 1d6f1f329839f0e2e43877ca797606881e8067b45d137daf4e6fb8ac62277948
MD5 1f0c4ab7746c05abd80b500b4ec9d418
BLAKE2b-256 5c785ddbd78aa73dd2598e6b7278fc6797b81ef7b4a1b797ded66925d96e9ea3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjpeg-0.4.tar.gz:

Publisher: publish.yml on robert-ancell/pyjpeg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyjpeg-0.4-py3-none-any.whl.

File metadata

  • Download URL: pyjpeg-0.4-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyjpeg-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 567d8e75de47a2438c3e9d0ae7ff3857e37f9d3e85e45b1780932a355fe853bd
MD5 0a119ee610793b564e100cfec210359d
BLAKE2b-256 3c9e60241594277317bee7c8379a55d2c4fb63f227ffaf710127094bd186257a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjpeg-0.4-py3-none-any.whl:

Publisher: publish.yml on robert-ancell/pyjpeg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.9

2 files

0.8

2 files

0.7

2 files

0.6

2 files

0.5

2 files

This release

0.4 This release

2 files

0.3

2 files

0.2

2 files

0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page