TG12864B Graphic LCD

Hi,
I'm using Arduino MEGA 2560.
I'm trying to insert some images (16x16, 32x16 ... 128x64) to GLCD display but I have a problem.
I'm using "openGLCD" library.
If I execute the examples, there is no problem(s). It is working everytime.
But if I try to execute my image, result always like what is attached below.
Here is my steps for trying to display the image:

  1. set an image around (1x1, ... 16x16, 32x16 ... 128x64)
  2. set an image from png or jpeg to bmp (monochrome)
  3. convert the bmp image to hex code. (I tried these converters below:
    a. Learn on the fly : Online tool to convert bitmap to hex codes for Arduino Graphic LCD 84x48 with PCD8544 controller Nokia 5110
    b. BMP-LCD
    c. LCDAsistant )
  4. send bmp image to library bmp image file (which library I'm using)
  5. send hex file to bitmaps file.
    than run the arduino.
    For openGLCD library I'm using this code to run;

#include "openGLCD.h"
#include "bitmaps/(image).h"

/const unsigned char bitmapArray [] = {
0x3f, 0x7f, 0xff, 0xff, ..
};
/

void setup() {
GLCD.Init();
}

void loop() {
GLCD.ClearArea();
GLCD.DrawBitmap((image), 32, 0, BLACK);
delay(3000);
}

there is a 2 option for us;

  1. you can apply what I told below.
  2. you can use the hex file content (const unsigned char bitmapArray [] (variable name not important))
    and change the name image instead of your variable name.
    So in this way, you can ignore the 4. and 5. steps.
    This is what I tried with openGLCD library.
    I tried this with u8g library (maybe I used the wrong identifier).
    If you wonder I checked up over 20 example and results always same.
    So how can I fix this issue and can I make my own bitmap images?

Attach the actual JPG image that you want to convert.

Then we can show you how to do it.

OpenGLCD uses an unusual format for its monochrome bitmap files.
i.e. different to Adafruit_GFX
i.e. different to U8g2 XBM

The normal online tools create GFX and XBM.
Some will create the KS0108 style.

David.

Hi David.
An image not important for now. I just want to do it without examples.
So for example we can try Bundesliga image would be good.
I couldn't find attachment in Reply table. So I just sharing a link.
https://images.app.goo.gl/bFNRTUrzKGq6WUJV6
And which library should I use for TG12864B?

Your link shows several colour images. The TG12864 is monochrome.

You have to choose one. And how it is rendered in black and white. (or blue and white if your GLCD is blue and white)

There are several "LCD converter" programs for the PC. And several that are online.

Some of them seem to offer different formats but do not work properly.

I would prefer using GFX or XBM format that are both supported by U8g2 and Adafruit_SSD1306. Most importantly these formats are used by "most" Arduino libraries. Which means that you can write a program for the KS0108. And port to an OLED or different GLCD.

Likewise, using a standard PC format like .BMP means that your images are portable.

Perhaps Bill Perry can recommend an online program that actually works.

OpenGLCD does come with a Processing application for the PC. But this involves installing Processing on your PC. Or executing a Java program. So it requires a bit more knowledge than using an online program.
Likewise it comes with source code for a commandline utility. But this involves installing PC compilers etc on your Windows PC.

David.

I tried something but it did not work.
So I didn't get enough from you.
Can you help me step by step?
Any image will be okay for me until when I do it succesfully.

Choose the particular logo. e.g. row 2, column 3

Are you asking for size?
if it is,
32x16 would be enough. I mean 32(column)x16(row).
it is not important the logo displayed on which side on the display.
İf you asking where should be the logos first row and column.
I think it can be display on middle of the screen.

You posted a link that shows a main image. e.g. a red footballer against a green football pitch.
Underneath there are several smaller images. You can choose one by position e.g. 3rd on 2nd row

Or by copying a link location e.g. https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSeMvllzZonmPghXsDD5QI-lsE8FxvgHA9XwA&usqp=CAU

None of the images are monochrome. None are Blue.

You can't just copy the hi-res logo. It will look horrible on a 128x64 GLCD.
You will probably just choose the white footballer against a solid rectangular background.
With or without text.

Think about road signs or toilet signs. You recognise the icon without needing to know the language.
e.g. you go through the correct door when you want to use the toilet.

Incidentally, logos look better on colour screens. even a tiny 32x16 pixel logo.
They always look blocky on a monochrome GLCD.

David.

So chose an image.

[u]https://ibb.co/8cLg2L7[/u] --> this one is not monochorome

[u]https://ibb.co/5sBfpsX[/u] --> this one is monochorome

Both images size are 70x56.

Can you tell me about for my first is these steps are ,which is from my post, correct?
"
Here is my steps for trying to display the image:

  1. set an image around (1x1, ... 16x16, 32x16 ... 128x64)
  2. set an image from png or jpeg to bmp (monochrome)
  3. convert the bmp image to hex code. (I should use GFX or XBM)
  4. send bmp image to library bmp image file (which library I'm using)
  5. send hex file to bitmaps file."
    "

You can load the JPG image into IrfanView or GIMP.
Scale it from 70x56 to say 32x25
Convert to monochrome.
Most importantly view the 32x25 image on your PC. Are you happy?
Store as .BMP or .JPG

Your first job is to choose which library to use. OpenGLCD or U8g2. This determines the bitmap format required.

Convert to GFX or XBM C array either with GIMP or with an online program.
If you say which library and whether 32x25 is a good size, someone might create the C array for you.

David.

I want to use openGLCD library because I have no idea about U8g2 library.
I know simple function in openGLCD library at least.
openGLCD library using XBM format looks like.

So images hosted at ImgBB — ImgBB this link will be enough for me I scaled it to 32x25.
So I got this png as xbm format and as bmp format.

So openGLCD library and 32x25 okay for me.

I found this program on the Internet. https://www.electronicwings.com/download/attachment=Sat-07-17-15-15-17.Image2GLCD.zip

It is very simple. It will take a PNG or JPG and convert into a C array in one go. It can resize too.
A lot easier than learning how to use GIMP or IrfanView.

I attach a file that contains both a GFX style array and a OpenGLCD style array. in 128x64 size
Note that you have to do some minor edits. e.g. add PROGMEM attribute.

I suggest that you display the 128x64 array and see what you think.
Then try the program with Custom 70x56 or 32x25

David.

Image2GLCD.h (12.5 KB)

David Thanks for all but there is 1 more problem.
in your header file there is a 2 variable if I upload first one
const unsigned char img_GLCD[1024+2] PROGMEM = { 128, 64, ... };
which is do not have [ x + (2)] and (128, 64,) that do not work correctly but second variable
which is I wrote below that works smoothly.

for the same image and same converter;
I converting it and than that give C and H file so C file have only 1 variable so Header file too but
in H file variables do not have input. such as extern const unsigned char img[]; and variable has 1 more
property which is 'extern' .
Anyway when I run the variable which is in C file
Result is same with what I posted first
I'm talking for this variable const unsigned char img[1024] = { ... };
But if I add these function and input const unsigned char img[1024 + 2] PROGMEM = { 128, 64, ..};
+2 for size of an image and PROGMEM is fuction for SRAM I guess.
So if I run this result is;

In fact I'm using same image and converter with you. and code is:

#include "openGLCD.h"

const unsigned char img[1024 + 2] PROGMEM = { 128, 64, ..};

void setup() {
GLCD.Init();
}

void loop() {
GLCD.ClearArea();
GLCD.DrawBitmap(img, 0, 0, BLACK);
delay(3000);
}

But still not working.
I checked how to use this converter and it is very simple how thought about it.
The variable inputs are, which is converted by Image2GLCD,;
const unsigned char img[1024] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xF8, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xFF, 0x1F, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xFC, 0x07, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x07, 0xF0, 0x0F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1F, 0xC0, 0x0F, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0x00, 0x1F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFE, 0x00, 0x1F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xF8, 0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xF8, 0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x80, 0x00, 0x3F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFE, 0x00,
0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0x80,
0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xC0,
0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xC0,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xC0,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xC0,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x1F, 0xFF, 0xC0,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x07, 0xFF, 0x80,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x01, 0xFE, 0x00,

0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1F, 0xFF, 0xE0, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x07, 0x03, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xF8, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1F, 0x9F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1F, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

This is a 70x56 bitmap:

// this file generated by Image2GLCD
const unsigned char img_GLCD2[490 + 2] PROGMEM = {
    70, 56,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xF0, 
0x78, 0x7C, 0x3E, 0x1E, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0x3F, 0x3F, 0x3F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 
0x0E, 0x0F, 0x07, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xE0, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x80, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xE0, 0xC0, 0x00, 0x00, 
0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F, 0x3E, 0x7E, 0x3E, 0x3C, 0x3C, 

0x3C, 0x78, 0x78, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x70, 0x70, 0x30, 0x00, 0x03, 0x07, 0x0F, 0x0F, 
0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x80, 0xE0, 0xF8, 0xF8, 0xF0, 0x70, 0x78, 0x3C, 0x3E, 0x3E, 0x1F, 0x1F, 0x0F, 
0x0F, 0x0F, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x87, 0x83, 0x81, 0x80, 0x80, 0x80, 0x80, 
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 
};

And this will display it:

#include "openGLCD.h"
#include "image2GLCD.h"

void setup() {
    GLCD.Init();
}

void loop() {
    GLCD.ClearArea();
    GLCD.DrawBitmap(img_GLCD2, 0, 0, BLACK);
    delay(3000);
}

Note that the bitmap has been edited:

  1. to change the array name
  2. to add PROGMEM attribute
  3. to insert the width, height fields.

It looks much better than the 128x64 images which have been stretched out of proportion.

From the OpenGLCD html doc

void DrawBitmap (Image_t bitmap, uint8_t x, uint8_t y, uint8_t color=PIXEL_ON);
void DrawBitmapXBM (ImageXBM_t bitmapxbm, uint8_t x, uint8_t y, uint8_t color=PIXEL_ON);
void DrawBitmapXBM_P (uint8_t width, uint8_t height, uint8_t *xbmbits, uint8_t x, uint8_t y, uint8_t fg_color, uint8_t bg_color);

So you can use different methods. Note that DrawBitmap() The bitmap data is assumed to be in program memory. Hence PROGMEM

If you use the XBM format, you can display XBM from SRAM or PROGMEM
The difference is with the XBM_P method you provide width, height as arguments.
Note that you can use the same utility for generating XBM. Select

XBM image has different bit order to GFX  i.e. LSB to MSB left to right. Invert

I could generate good XBM arrays for 128x64. However custom 70x56 arrays produced garbage. I am not sure why.

David.

Edit. Corrected the XBM statements.

Oh I'm sorry about last problem. Becase there were no problem at all.
That was just my mistake about using the converter.
It is working smootly now.
I'm reilly appreciated.
Thank you for your patience despite of some unnessesary questions (such as last one).

I have discovered that the "convenient" program does not work properly for some geometries.
It will generate a GLCD format almost ok for 70x56 e.g. for OpenGLCD
But any GFX or XBM formats need to be on 8-bit boundaries e.g. 72x56

// this file generated by Image2GLCD 
// https://www.electronicwings.com/download/attachment=Sat-07-17-15-15-17.Image2GLCD.zip
// GFX image is default i.e. MSB to LSB left to right. Invert
// XBM image i.e. LSB to MSB left to right. Invert
// OpenGLCD image is LSB to MSB Top to Bottom.  Invert
// Rename array, add PROGMEM.   Alter array size and geometry for GLCD.
//
// this program will resize your PNG file if you tick Custom.
// it looks pretty blocky
//
// Note that any custom image must have width on an 8 column boundary.
// Otherwise the GFX / XBM (left to right) formats are wrong.

Online converters like https://www.skaarhoj.com/FreeStuff/GraphicDisplayImageConverter.php will cope with scaling and odd size geometries but will only produce GFX format arrays.

David.