🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [Solved]M5StickC and colour images

    M5 Stick/StickC
    5
    10
    14.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      ojdas
      last edited by m5-docs

      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

      1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3
        last edited by ajb2k3

        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.

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        1 Reply Last reply Reply Quote 0
        • O
          ojdas
          last edited by

          What program generate data in file Logo.c here https://platformio.org/lib/show/6246/M5StickC

          1 Reply Last reply Reply Quote 0
          • m5-docsM
            m5-docs
            last edited by

            Hello guys @ojdas @ajb2k3,

            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().

            M5Stack documentation URL

            https://docs.m5stack.com

            O 1 Reply Last reply Reply Quote 0
            • O
              ojdas @m5-docs
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • lukasmaximusL
                lukasmaximus
                last edited by

                you could use krita or piskell they both can convert images to c file @ojdas

                O 1 Reply Last reply Reply Quote 0
                • O
                  ojdas @lukasmaximus
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • m5-docsM
                    m5-docs
                    last edited by

                    @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.

                    M5Stack documentation URL

                    https://docs.m5stack.com

                    O 1 Reply Last reply Reply Quote 0
                    • O
                      ojdas @m5-docs
                      last edited by

                      @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.

                      1 Reply Last reply Reply Quote 0
                      • A
                        Axum360
                        last edited by

                        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
                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post