Skip to main content

NvJpeg - Python

Require

  • nvjpeg
  • cuda >= 10.2
  • numpy >= 1.7
  • python >= 3.6
  • gcc >= 7.5
  • make >= 4.1

System

Linux(x86, x86_64) Nvidia Jetson OS

Install

pip install pynvjpeg

Usage

0. Init PyNvJpeg

from nvjpeg import NvJpeg
nj = NvJpeg()

1. Use PyNvJpeg

Read Jpeg File to Numpy

img = nj.read("_JPEG_FILE_PATH_")
# like cv2.imread("_JPEG_FILE_PATH_")

Write Numpy to Jpeg File

nj.write("_JPEG_FILE_PATH_", img)
# or nj.write("_JPEG_FILE_PATH_", quality)
# int quality default 70, mean jpeg quality
# like cv2.imwrite("_JPEG_FILE_PATH_", img)

Decode Jpeg bytes in variable

img = nj.decode(jpeg_bytes)
# like cv2.imdecode(variable)

Encode image numpy array to bytes

jpeg_bytes = nj.encode(img)
# or with jpeg quality
# jpeg_bytes = nj.encode(img, 70)
# int quality default 70, mean jpeg quality

# like cv2.imencode(".jpg", variable)[1]

Metadata

Release files for pynvjpeg 0.0.13

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

Source distribution (sdist)

Source distribution for pynvjpeg 0.0.13
File Size Uploaded Provenance Actions
pynvjpeg-0.0.13.tar.gz 11.3 kB Without provenance Details for pynvjpeg-0.0.13.tar.gz

Release files / pynvjpeg-0.0.13.tar.gz

Download URL pynvjpeg-0.0.13.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d2d84f26395178414c325a18dd83f7fa0fe83b14d9d0b0e8bc0adb7648738360
BLAKE2b-256 checksum
How to use checksums
4ad3cdafe2fdebae3a7e219e8db0ddc8c9f67ee72a466dc095f56b12c0280252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0

Security for pynvjpeg 0.0.13

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