This is a ShittyCameraChallenge contribution to shoot 16-color (not 16-bit!) pictures on the ESP32-CAM.
There is a full write-up on the author's blog.
Example image:
There is a bunch of #define
s in the source to enable or disable various "features" of the project:
WARMUP_PICS
- number of pictures to discard while AWB is calibratingSTORE_{RAW,RGB,TGA}
- which file formats you want to end up on the SD cardSTORE_DITHER_*
- which dither modes you want to store (see blog post)HEIGHT
- you can set that to 240 to keep the 1:1 pixel aspect ratio. In theory, other resolutions might be possible if they match thepixel_format
value.FORCE_8BPP_TGA
- disable this to store a more compact but not supported by any modern viewer 4bpp packed TGA file
DO NOT TOUCH THE OTHER KNOBS!
To correct the non-square pixel aspect ratio and to better see the original
pixels, it's recommended to upscale the image to 400%*480%, e.g. by using
the following Makefile
on the SD card:
TGA=$(patsubst %.tga, %.png, $(sort $(wildcard *.tga)))
all: $(TGA)
%.png: %.tga
convert $< -scale 400%x480% $@
This "feature" emulates a Nintendo GameBoy Camera. It can be toggled with the
STORE_CHINA_EXPORT
flag.
The RGB565 image taken will be downscaled to 128x112 (GBC output resolution), dithered to 4 greyscale colors, and put into the middle of a 160x144 image file.
For that, you need to generate ce_data.h
by running python3 gen_ce_h.py
- this
script will expect a 160x144 PNG image under "china-export.png".