shariltumin / esp32-cam-micropython-2022

MicroPython esp32-cam firmware with camera support compiled with esp-idf-4.4.0. Python script files for live streaming
MIT License
174 stars 33 forks source link

firmwares-2023-0717 picture quality #30

Open davefes opened 11 months ago

davefes commented 11 months ago

With firmware-20221203 and the following parameters:

   camera.pixformat(0) #  0:JPEG, 1:Grayscale (2bytes/pixel), 2:RGB565
    camera.framesize(10) #  1:96x96, 2:160x120, 3:176x144, 4:240x176, 5:240x240
                         #  6:320x240, 7:400x296, 8:480x320, 9:640x480, 10:800x600
                         #  11:1024x768, 12:1280x720, 13:1280x1024, 14:1600x1200
                         #  15:1920x1080, 16:720x1280, 17:864x1536, 18:2048x1536
    camera.quality(5) #  [0,63] lower number means higher quality
#    camera.contrast(0) #  [-2,2] higher number higher contrast
#    camera.saturation(0) #  [-2,2] higher number higher saturation. -2 grayscale
#    camera.brightness(0) #  [-2,2] higher number higher brightness. 2 brightest
    camera.speffect(2) #  0:,no effect 1:negative, 2:black and white, 3:reddish,
                       #  4:greenish, 5:blue, 6:retro
#    camera.whitebalance(0) #  0:default, 1:sunny, 2:cloudy, 3:office, 4:home
#    camera.aelevels(0) #  [-2,2] AE Level: Automatic exposure
#    camera.aecvalue(0) #  [0,1200] AEC Value: Automatic exposure control
#    camera.agcgain(0)  #  [0,30] AGC Gain: Automatic Gain Control

I was getting reasonable picture quality. I have tried many options on the new firmware and can't achieve anything close to the previous. Which options should I choose? Black and white is good for me.

Is the grayscale still 2bits or 8bits?

Also, in my code: https://github.com/davefes/ESP32-CAM-Micropython/blob/main/main.py I was testing to ensure that I had a JPEG file. This appears to be not necessary now. Are all pixformats jpeg?

Thanks.