[Solved]M5StickC and colour images
-
Hi,
Where I can find some information how to add colour images to display on screen?
I need some examples how to present png, jpg etc. files?
Any tutorials are appreciated.Regards,
Piotr -
The screen has a resolution of 80px X 160px,
Images must be .jpg (.JPEG not supported),
File size must be smaller than 24KBits,
Progressive and Lossless JPEG format is not supported,
Gray scale image are not supported.This section of the documents is largely unwritten and untested at present as I'm working on the document but have problems with the Stick C.
-
What program generate data in file Logo.c here https://platformio.org/lib/show/6246/M5StickC
-
You need to transfer your picture to array[] first, so that M5StickC can display through callback this array[].
e.g. gImage_logo[25600] in the logo.c file
const unsigned char gImage_logo[25600] = { /* 0X00,0X10,0X50,0X00,0XA0,0X00,0X01,0X1B, */ 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
The library of M5StickC has not owned any function whick can callback a image file directly likes imge_jpg(), imge_png(), imge_bmp().
-
@watson I know that but could you please recommend software which I could use to convert image file to array?
I have tried many but I didn't find any correct one :(
Any help appreciated. -
you could use krita or piskell they both can convert images to c file @ojdas
-
@lukasmaximus Guys I need your help regarding conversion. What type of files we can convert, what type of conversion I need use, as I see that we have many RGB types, and so on...
I need step by step information :( Thank you in advance. -
@ojdas In principle, StickC supports any format of image file data. If you can transfer your image file to Hexadecimal array, then write the Hexadecimal array to StickC. It will display the image.
-
@m5-docs Generally yes, but as I said I have tried to convert e.g. PNG to hex array, but when I want to call the image is not proper displayed or the colour is changed :( So if possible I need help from someone to have an example how step by step prepare image, convert to hex and add (code) all to M5StickC. So anyone who face an issue like me will could use such tutorial.
-
As Google has led me here, I'd like to answer this question.
an image file needs to be converted to a C file using RGB565 little endian.
To do this you have two options:- use the web tool at https://lang-ship.com/tools/image2data/ to convert the image
- use your favorite programming language to dump it