How to use the GitHub custom Library

I have a camera module that only supports the RGB565 format and does not natively capture images in JPEG format. To work around this, I first capture the image in RGB565 and then encode it into JPEG.

I found a GitHub repository that provides code for this conversion:
GitHub Repository - JPEGENC

How do I integrate this github repo into my code so that I can make use of it.

Welcome to the forum

Did you look at the examples that come with the library ?

1 Like

Yes there is an example. But I am completely new to Arduino and I dont know how to use the library at all.

You can see it in RGB565_demo example that is a ready to use Arduino skecth.

1 Like

I could not find it. Do we need to download it externally? I want to encode the rgb565 to jpeg.

It is in the examples for the library. How hard did you look ?

I know about the demo example. My question is how do I use this library example in my own code. It requires me to have JPEGENC library so how I structure those files in my workspace/folder accordingly.

If the library is not available from the Arduino IDE Library Manager then download the .zip file from GitHub then in the IDE use Sketch/Include Library/ Add .ZIP file and the library will be installed and accessible from the IDE

2 Likes

Hi @bidhant. The first thing to do is to install the library. You can do that using the Arduino IDE Library Manager. I'll provide instructions:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
  2. Type JPEGENC in the "Filter your search..." field.
  3. Scroll down through the list of libraries until you see the "JPEGENC" entry.
  4. You will see an "INSTALL" button at the bottom of the entry. Click the button.
  5. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    ⓘ Successfully installed library ...

You will now find the example sketches for the library under the File > Examples > JPEGENC menu in Arduino IDE. Study those examples to learn how to use the library in your own sketches.

1 Like

Yes this worked for me. Also I found that the "esp_camera.h" had a built in library which could decode the rgb565 images to jpeg easily. I just had to use "frame2jpg()" to get it done. Thanks for the help community.

1 Like