4 Color .97in Epaper Display w/ ESP8266

GxEPD and GxEPD2 does not yet support this display from what I see. I would like to find more libraries for this display or help someone like @ZinggJM to help gain traction on this display as small 4 color epaper displays are becoming more common. I am not sure what it take to support this but I am finding it be very difficult on my end to get anything displayed other than the demo.

Here is where the display can be found [GDEM0097F51] 0.97-Inch E Ink Display Yellow and Red E-paper GDEM0097F51 Energy Efficient, High Contrast Screen for Smart Devices

Demo Code located at the bottom of main page.

Image Converter Code I was given by the supplier

// 4-Color Grayscale Processing Function for ePaper Displays
// Converts image data (RGB) into grayscale values and stores them in a compact format.

else if (mode === 'fourColor') {
    const width = imageData.width;
    const height = imageData.height;
    const data = imageData.data;
    const processedData = new Uint8Array(Math.ceil((width * height) / 4)); // Array size for 4-gray-scale mode

    // Function to convert RGB colors to grayscale in 4-gray-scale mode
    function rgbToGray(r, g, b) {
        const grayscale = Math.round(0.299 * r + 0.587 * g + 0.114 * b);
        if (grayscale < 64) return 0x03;  // Black
        if (grayscale < 128) return 0x02; // Red
        if (grayscale < 140) return 0x00; // Yellow
        return 0x01;                      // White
    }

    // Process the image data row by row
    for (let y = 0; y < height; y++) {
        for (let x = 0; x < width; x++) {
            const index = (y * width + x) * 4; // Get pixel index (RGBA format)
            const r = data[index];            // Red channel
            const g = data[index + 1];        // Green channel
            const b = data[index + 2];        // Blue channel
            const grayValue = rgbToGray(r, g, b);

            // Store grayscale values in the processedData array
            const newIndex = (y * width + x) / 4 | 0; // Calculate the new index
            const shift = 6 - ((x % 4) * 2);         // Determine bit position
            processedData[newIndex] |= (grayValue << shift);
        }
    }

    return processedData; // Returns the processed grayscale data
}

Both links were blocked by my security software.

My security software allows it! (Trend Micro).

Discouraging posters that have questions on e-paper displays or GxEPD2 is somewhat welcome.

But you could tell them that GxEPD2/discussions are enabled.

I don't know how I would do that and I prefer it that way.

Just FYI, here is what happens


AFAIK, Trend Micro is Anti-Virus which has been obsolete for many years now, I use two anti-malware addons to my Mac and several anti Adware.
NOTE I can't even get into sites I need to and that hanged in the last few days/weeks so whatever is causing that may be causing your sites as well especially as it's the same error page being displayed.
When it bothers me enough I will figure it out.

Maximum Internet Security Software | Trend Micro (UK) is more than Anti-Virus.
I chose UK instead of CH for English language for you.

Your error message would indicate an issue with your DNS setup or provider.

Only certain sites, don't worry, tight security is often inconvenient. Most likely some other person encountered some malware and blacklisted them.

Here is the display product link. It looks like for some reason the link to the downloadable demo is HTML. Not sure that is the issue but at the bottom of product page you'll fine the link to the demo code for ESP8266 0.97-Inch E Ink Display Yellow and Red E-paper GDEM0097F51 Energy Efficient, High Contrast Screen for Smart Devices

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.