Skip to main content

NvJpeg - Python

Require

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

Install

pip install pynvjpeg

Usage

#!/usr/bin/env python3

from nvjpeg import NvJpeg 

# read file
fp = open("input-image.jpg", "rb")
jpegData = fp.read()
fp.close()

# decode
nj = NvJpeg()
img_np = nj.decode(jpegData)

# use opencv show numpy image data
cv2.imshow("Demo", img_np)
cv2.waitKey(0)

# encode numpy image data
jpg = nj.encode(img_np)

# write file
fp = open("output-image.jpg", "wb")
fp.write(jpg)
fp.close()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynvjpeg-0.0.6.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file pynvjpeg-0.0.6.tar.gz.

File metadata

  • Download URL: pynvjpeg-0.0.6.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9

File hashes

Hashes for pynvjpeg-0.0.6.tar.gz
Algorithm Hash digest
SHA256 7c48c8ff8d4270fe00b39479448bad063a35895369a423594ed27123e311a53b
MD5 bef7c04df79352d41567d4539cf43df6
BLAKE2b-256 e2e5ab383e862f8cd3a3add91a7096986ccd1653e9340523e1891a0d1610d13d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.13

1 file

0.0.12

1 file

0.0.11

1 file

0.0.10

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

This release

0.0.6 This release

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page