Code or library for RGB value extraction from JPEG

Hi all, I would like to ask something.

I tried to make some machine that take picture from camera

I succeeded to take picture and save it in sd card

but I don't know how to extract RGB values in specific area in jpg.

is there anyone who know about this ? :slight_smile:

would probably be easier to extract the RGB values if you saved your pictures as bitmap format instead.

https://stackoverflow.com/questions/16784885/read-rgb-triplets-of-jpeg-files-in-c
"The JPEG file format does not store the rgb triplets directly but it uses some sort of image compression. The file actually contains blocks of 64 (if I remember correctly) pixels which are attributed with a cosine pattern defining the actual colors.

You really should use a library (libjpeg, imagemagick, gd, ... e.g., depending on your use case) to read and decode the files and generate the rgb triplets in memory."

but was not to find any such library for arduino boards...

Try JPEGDecoder - Arduino Reference

Read the description in GitHub as there are some constraints to take into account

This^^^^

The question is can the camera save as bitmap?

With some tweaking it seems esp 32 cam take photo on BMP - #4 by Danois90