Hi everyone!
In this instructable, I'm going to be going through the process of how you can get images to display on OLED displays such as this one: https://amzn.com/B00O2LKEW2. For this tutorial I'll be using an ATtiny85, so some of the sketches I provide will not work on other Arduino devices. However, the process for making and preparing the image files should be exactly the same for most microcontrollers, so this tutorial should be helpful.
I'll be using the following software:
I use Photoshop to make monochromatic images and export them as bitmaps, but if you have an image you want to display you can use an online program to convert it to a bitmap file and load it into LCD Assistant.
LCD Assistant is a Windows-only program. I'm on a Mac, so I'm using Winebottler to run the .exe file. It works like a charm! You can download Winebottler here: http://winebottler.kronenberg.org. If you're having trouble getting anything to work don't hesitate to email me at info[at]coniferapps.com. TL;DR: this should work on any platform even if you don't have Photoshop.
Let's get to work! If you don't have Photoshop but have your 128x64 .bmp file then you can skip this step. (Step numbers correspond to the images above)
Now we're going to turn the .bmp file into a format that can be read by your microcontroller (Step numbers correspond to the images above)
Now we have a header file that can be imported used in the Arduino IDE! There's just one quick thing we need to do before we can use it.
We just need to make one quick addition to the .h file before we can use it.
This tells the compiler that you want this variable loaded into the program memory and not the memory used for global variables. The ATtiny doesn't have enough space in the memory that stores global variables to hold this, so it needs to go in the flash storage devoted to programs.
The variable itself is an array of hexadecimal values specifying the state of each pixel. Our image has 8192 pixels (128x64), and there are 1024 hex values in that array. Each hex value can represent one byte of information (8 bits), and each pixel in our bitmap image is one bit (black=0, white=1). Isn't it awfully coincidental that 8 bits per byte x 1024 bytes is equal to 8192 bits, the exact number of pixels? (it's not a coincidence ☺)
Attached is a sample Arduino file that you can run on an ATtiny85 connected to a 128x64 I2C OLED display. I'm using the library from the following instructable: https://www.instructables.com/id/ATTiny85-connects-to-I2C-OLED-display-Great-Things/. My program just displays the sample image I created. If you want to test your own, replace FileForOLED.h with your own file and rename things in the Arduino sketch as necessary. Thanks so much for reading, and I hope this was helpful. If you have any questions please email me at info[at]coniferapps.com or post them in the comments.