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.3.tar.gz (44.5 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.3-py3-none-any.whl (58.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyjpeg-0.3.tar.gz
Algorithm Hash digest
SHA256 b8b20fb03fe1e1e9c1e2f35a4cf329a309c9d3b8ae26fb6e2a7f3d45c1d199ef
MD5 60fa9427614af1bc6c03ecce7eea4bb8
BLAKE2b-256 ed4db03c185ba00b3ef4fed9dffff8245dc0523aa9c61e0f63a1a12527c6cdeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjpeg-0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: pyjpeg-0.3-py3-none-any.whl
  • Upload date:
  • Size: 58.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4c524723e3dcc2c16483ce396267ff9c329909b7d1d5e533a0f35e88f4dd4842
MD5 08c5e9afd914425a5bae06a3ab643eb7
BLAKE2b-256 4fd2b94ed8ecf9abec9de89c5739bea613c6c14fb1d19d094fb4931be0c56d11

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjpeg-0.3-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

0.4

2 files

This release

0.3 This release

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