ethereon / lycon

A minimal and fast image library for Python and C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lycon image loading gives different pixel values than Pillow

jalexhurt opened this issue · comments

When using lycon to load an image, the pixel values differ from loading from PIL and converting to NumPy

Reproduce:

import lycon
import numpy as np
from PIL import Image

path = "/path/to/image.jpg"

img1 = lycon.load(path).astype(np.float32)
img2 = np.asarray(Image.open(path)).astype(np.float32)

np.all(img1 == img2)

This will return False. In my testing the pixel values differ in ~11% of locations and differ by an average of 1.46

So in 11% of the image, if the PIL pixel value is 144, lycon is either around 145.5 or 142.5.