Metadata-Version: 2.4
Name: pyjpeg
Version: 0.4
Summary: Pure Python JPEG image encoder/decoder
Project-URL: Homepage, https://github.com/robert-ancell/pyjpeg
Project-URL: Issues, https://github.com/robert-ancell/pyjpeg/issues
Author-email: Robert Ancell <robert.ancell@gmail.com>
License-Expression: LGPL-3.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

This repository contains a Python encoder and decoder for the [JPEG file format](https://jpeg.org/jpeg/).

The easiest way to get PyJPEG is to install from the [Python Package Index](https://pypi.org/project/pyjpeg/):
```
pip install pyjpeg
```

Example:
```python
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)
```
