Skip to content

Releases: lilohuang/PyTurboJPEG

Improved encode() error handling on wrong array shape

08 Jan 11:32
ae3da71
Compare
Choose a tag to compare
  1. Improved encode() error handling on wrong array shape (silent crash on wrong array shape (#57)
  2. Added an extra turbojpeg default path for Mac OS

Fixed lib paths missing on NetBSD

01 Jan 13:21
96a8dfe
Compare
Choose a tag to compare

Fixed lib paths missing on NetBSD #55

fix incorrect logic on scale_with_quality()

06 Nov 04:53
6f3706d
Compare
Choose a tag to compare

scale_with_quality() returns empty data if decoding the image to be scaled triggers a warning. #53

Use libturbojpeg.so instead of libjpeg.so in FreeBSD.

27 Oct 13:14
ade9c3e
Compare
Choose a tag to compare

Use libturbojpeg.so instead of libjpeg.so in FreeBSD. #51

v1.6.1

21 Sep 01:37
a0adeb1
Compare
Choose a tag to compare

Map luminance level to dct coefficient #49

Here is an example to utilize @erikogabrielsson his contribution.

from PIL import Image
import numpy as np
import io
from turbojpeg import TurboJPEG

jpeg = TurboJPEG(r'C:\libjpeg-turbo64\bin\turbojpeg.dll')
in_file_path = r'in-1024x1024.jpeg'
in_file = open(in_file_path, 'rb')
in_data = in_file.read()
in_file.close()

# Crop the image to a larger size, fill extended area with white (1).
out_data = jpeg.crop_multiple(in_data, [(0, 0, 2048, 2048)], 1)[0]

# Write to file for analysis.
out_filepath = r'out.jpeg'
out_file = open(out_filepath, 'wb')
out_file.write(out_data)
out_file.close()

# Quick check that the end of the image array is RGB 255, 255, 255
np.asarray(Image.open(io.BytesIO(out_data)))

Support for multiple crop and fill background

20 Sep 14:18
c253258
Compare
Choose a tag to compare

crop_multiple() has been added to support for multiple crop and fill background #48

Add FreeBSD search path to avoid KeyError. 

14 Sep 00:02
49f6da4
Compare
Choose a tag to compare

Add FreeBSD search path to avoid KeyError.  #47

Add default path to library in openSUSE systems

07 Sep 09:24
9da7e1d
Compare
Choose a tag to compare

Add default path to library in openSUSE systems #45

Modify encode function to support 1-channel input

16 Aug 10:51
e2badc1
Compare
Choose a tag to compare

Modify encode function to support 1-channel input #42

Adding more code examples

20 Jun 01:59
84530b5
Compare
Choose a tag to compare

Adding more code examples,

  1. decoding input.jpg to BGR array with fast upsample and fast DCT. (i.e. fastest speed but lower accuracy)
  2. using PyTurboJPEG with ExifRead to transpose an image if the image has an EXIF Orientation tag