Skip to main content

nvjpeg for python

Project description

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()

Project details


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.

Supported by

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