Skip to main content
ReadTheDocs Project generated with PyScaffold

ljpeg

Read and transform LJPEG images into modern formats.

Installation

Warning: You must have installed the flex parser on your operating system:

pip install ljpeg

By default, we offer you a binary called jpeg_static. However, you can produce your jpeg binary:

cd jpegdir && make

Getting started

Download a set of mammograms with:

wget -r -q ftp://figment.csee.usf.edu:21/pub/DDSM/cases/normals/normal_08/case4606/

Transform a lot of mammograms parallely:

find . -type f -name '*.LJPEG' | parallel -j+0 "ljpeg {} $(pwd)/{/.}.tiff --verify"

Convert to TIFF (requires the .ics file in the same directory as LJPEG):

ljpeg $(pwd)/C_0029_1.LEFT_CC.LJPEG $(pwd)/output.tiff

Convert to TIFF and verify that no information has been lost:

ljpeg $(pwd)/C_0029_1.LEFT_CC.LJPEG $(pwd)/output.tiff --verify

Convert to jpeg for visualization with down-sizing scale=0.3 (16-bit TIFF is not good for direct visualization):

ljpeg $(pwd)/C_0029_1.LEFT_CC.LJPEG $(pwd)/output.jpg --visual --scale 0.3

Convert to TIFF and map gray levels to optical density level:

ljpeg $(pwd)/C_0029_1.LEFT_CC.LJPEG $(pwd)/output.jpg --od-correct

Note that output file can be any format that’s supported by OpenCV (which includes all common types). Most file formats only support 8-bit images, so directly saving into such file formats will cause problems. Add “–visual” to normalize color into 8-bit before saving to such file formats.

The Stanford ljpeg code is in public domain and is therefore OK to be included here. I did minor modification to make the code compile under modern Linux.

Making Changes & Contributing

This project uses pre-commit, please make sure to install it before making any changes:

pip install pre-commit
cd demo-project
pre-commit install

It is a good idea to update the hooks to the latest version:

pre-commit autoupdate

Don’t forget to tell your contributors to also install and use pre-commit.

Note

This project has been set up using PyScaffold 4.2.2.post1.dev3+g01e6e81. For details and usage information on PyScaffold see https://pyscaffold.org/.

Metadata

Release files for ljpeg 3.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ljpeg 3.7.1
File Size Uploaded Provenance Actions
ljpeg-3.7.1.tar.gz 630.6 kB Without provenance Details for ljpeg-3.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ljpeg 3.7.1
File Interpreter ABI Platform Actions
ljpeg-3.7.1-py3-none-any.whl Python 3 none any Details for ljpeg-3.7.1-py3-none-any.whl

Total release size: 1.3 MB

Release files / ljpeg-3.7.1.tar.gz

Download URL ljpeg-3.7.1.tar.gz
Size 630.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4102ad79207853e56865f794dbf91a8552db398475013af919fc5e5dbf5bc11b
BLAKE2b-256 checksum
How to use checksums
a424f88bcb70888c99914b0f885d69760cc10e8cfc6db1f7b9f8593250060432
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / ljpeg-3.7.1-py3-none-any.whl

Download URL ljpeg-3.7.1-py3-none-any.whl
Size 628.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4971e8666f9c984cc46a8d17cd7c7e7de925dc1de2faaf4c8950e74f4f38d26d
BLAKE2b-256 checksum
How to use checksums
e93d800bf175ac86b458d2d23027b6fa2e6e15feca52751969db6faff6a6cd0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Security for ljpeg 3.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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