Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPEG reading has a bug #44

Open
stewart123579 opened this issue Jun 27, 2022 · 0 comments
Open

JPEG reading has a bug #44

stewart123579 opened this issue Jun 27, 2022 · 0 comments

Comments

@stewart123579
Copy link

stewart123579 commented Jun 27, 2022

Quicklisp: opticl-20211230-git

(Thanks to #14 for the hint of what I'm seeing)

There appears to be a bug in the read-jpeg code

(opticl:write-jpeg-file "/tmp/cat2.jpg" (opticl:read-jpeg-file "/tmp/cat.jpg"))

produces an output image which is different from the input image.


Looking at the RBG values in lisp (SBCL) and python I get different values.

(let ((img (read-jpeg-file "/tmp/cat.jpg")))
    (loop for x below (array-dimension img 1)
        minimize (aref img 100 x 1) into low
        maximize (aref img 100 x 1) into high
        finally (return (list low high))))

gives (132 255)

import numpy as np
from PIL import Image
image = np.array(Image.open("/tmp/cat.jpg"))
arr = image[100,:,1]
print(np.min(arr), np.max(arr))

gives (133 255)

i.e. minimum value is 132 or 133.


An example JPEG: Obligatory cat image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant