Python interface for nvjpeg. Encode/Decode Jpeg with Nvidia GPU Hardware Acceleration.
Project description
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]
Project details
Release history Release notifications | RSS feed
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.13.tar.gz
(11.3 kB
view details)
File details
Details for the file pynvjpeg-0.0.13.tar.gz
.
File metadata
- Download URL: pynvjpeg-0.0.13.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d2d84f26395178414c325a18dd83f7fa0fe83b14d9d0b0e8bc0adb7648738360
|
|
MD5 |
94cc0603f6e0d589ffb8c7fa61a41bb0
|
|
BLAKE2b-256 |
4ad3cdafe2fdebae3a7e219e8db0ddc8c9f67ee72a466dc095f56b12c0280252
|