TinyCircuits Forum

TinyCircuits Products => TinyDuino Processors & TinyShields => Topic started by: Sakuyal on August 01, 2019, 10:34:56 PM

Title: Converting Bitmap Images for Use With TinyScreen+
Post by: Sakuyal on August 01, 2019, 10:34:56 PM
Hello,

The Tinyscreen+ is super cool! Just got mine today.

I've been fiddling around with it for a bit and want to get some small 96x64 images to display on there without an SD card attachment... so I've been looking into byte array conversion.

I've spent a few hours reading forum posts and trying out various kinds of converters with no luck--the arrays I've generated so far just come out as garbage on the screen. It seems that it's a bit more complicated than what I previously imagined as well, with several ways to convert an image, and I haven't found anything that says that format the TinyScreen+ would like its byte arrays.

Does anyone know the specifications of the byte array that the TinyScreen+ likes? I've seen the Flappy Bird in the example, but the images I'm trying to display are much bigger and more complicated color-wise than that small sprite so I haven't been able to glean much from that.

I could just be being stupid since I'm new to working with bytes directly, but I would appreciate it if someone could point me in the right direction. Thanks!
Title: Re: Converting Bitmap Images for Use With TinyScreen+
Post by: Sakuyal on August 02, 2019, 02:34:57 PM
Alright, update to this.

So I've successfully drawn a very basic image (test.bmp attached) to the screen, but unfortunately the color palette isn't right and the image is mirrored. I recognized that the TinyScreen+ takes BGR instead of RGB colors, so I manually switched the R and B channels in Photoshop but unfortunately that didn't solve the problem. The second image attached shows what I get after switching the channels.

Help would be appreciated!
Title: Re: Converting Bitmap Images for Use With TinyScreen+
Post by: ZLee on August 12, 2019, 02:50:08 PM
Hi Sakuyal,

It's funny I went through the exact same process as you a couple of weeks ago while I was writing the Minecraft Compass Tutorial https://tinycircuits.com/blogs/learn/minecraft-compass  (https://tinycircuits.com/blogs/learn/minecraft-compass) for the TinyScreen+.

It turns out you can display about 13-15 bitmaps within the flash and RAM.

I have attached the compass code here, a converter that actually works, and the images I converted!

Basically, all you have to do is create a Sprite object and associate it with a bitmap in a header file:
Code: [Select]
Sprite compass1 = {offscreen, -14, 96, 96, 0, minecraft_compass1};

In this case, minecraft_compass1 is a bitmap within sprites.h that was generated with the attached converter.

Please let me know if you have any more issues with this project :)
Title: Re: Converting Bitmap Images for Use With TinyScreen+
Post by: rubberducky on October 18, 2023, 11:04:23 AM
hello are u able to provide steps on converting images with sprite ?