Skip to main content

DiffJPEG: A Jax Implementation

This is a Jax implementation of the differentiable JPEG compression algorithm, based on the PyTorch implementation and some of the modifications found in this repository to improve quality at high compression rates.

Requirements

  • JAX

Installation

Can be installed with pip:

pip install diffjpeg_jax

Usage

Unlike the PyTorch version, this is ML library agnostic, so it simply is implemented as a function. Inputs should be in the range [0, 255] and in the format (H, W, C).

from diffjpeg_jax import diff_jpeg

img = ... # (H, W, C)
jpeg = diff_jpeg(img, quality=75)

Note: The implementation is not wrapped in JIT, so make sure to do that if you want to. For batch processing just use vmap.

Metadata

Release files for diffjpeg-jax 1.0.0

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

Source distribution (sdist)

Source distribution for diffjpeg-jax 1.0.0
File Size Uploaded
diffjpeg_jax-1.0.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for diffjpeg-jax 1.0.0
File Interpreter ABI Platform
diffjpeg_jax-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / diffjpeg_jax-1.0.0.tar.gz

Download URL diffjpeg_jax-1.0.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c82647ce2fc98cc20a496db4845ce5f6cb20290dfaeedbf70fd24217247e5a17
BLAKE2b-256 checksum
How to use checksums
56de3d9c0166070dc90fdbda8f771c8bf58e2c21c59880e6e4dfeb83fbb4e084
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / diffjpeg_jax-1.0.0-py3-none-any.whl

Download URL diffjpeg_jax-1.0.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1915318f08693e5f87bc2f02a863f5fec49a65d5da6d4beab8184c5084674354
BLAKE2b-256 checksum
How to use checksums
36632dca458376b1ad329be977e82d9793b6089033ae010574206bf507a2a8f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release 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