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 "quality" argument ignored? #706

Open
qgeissmann opened this issue Sep 27, 2021 · 1 comment
Open

JPEG "quality" argument ignored? #706

qgeissmann opened this issue Sep 27, 2021 · 1 comment

Comments

@qgeissmann
Copy link

Hello,
I am using the pi camera HQ, on archlinux arm, and picamera==1.13 and attempting to set JPEG quality during capture.
Adapting the documentation recipe:

import time
import picamera
with picamera.PiCamera() as camera:
    camera.resolution = (1024, 768)
    camera.start_preview()
    # Camera warm-up time
    time.sleep(2)
    camera.capture('foo.jpg', quality=90)

I notice my images are the same approximate size regardless of what value I set for quality.
Using ImageMagick's identify confirms Quality is actually 100, not 90 as set:

identify -verbose /run/media/quentin/SPI_DRIVE/foo.jpg  | grep Quality
  Quality: 100

The documentation says:

Certain file formats accept additional options which can be specified as keyword arguments. Currently, only the 'jpeg' encoder accepts additional options, which are:
quality - Defines the quality of the JPEG encoder as an integer ranging from 1 to 100. Defaults to 85. Please note that JPEG quality is not a percentage and definitions of quality vary widely.

It seems that the default is actually 100 for this camera/setup?
Does anyone else have the same pproblem or a solution?

@6by9
Copy link
Collaborator

6by9 commented Sep 28, 2021

As in the docs:

definitions of quality vary widely

Picamera's quality parameter does not match with ImageMagick's. Such is life.

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

2 participants