Skip to content

Lycon image loading gives different pixel values than Pillow #19

Description

@jalexhurt

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions