[closed] Images not working



  • I'm trying to load an image but everytime I use the blocky version of this code

    from m5stack import *
    from m5ui import *
    
    clear_bg(0x222222)
    
    
    
    btnA = M5Button(name="ButtonA", text="ButtonA", visibility=False)
    btnB = M5Button(name="ButtonB", text="ButtonB", visibility=False)
    btnC = M5Button(name="ButtonC", text="ButtonC", visibility=False)
    image1 = M5Img(64, 19, "res/miniM5os.jpg", True)
    
    
    lcd.fill(0x3333ff)
    image1.changeImg("res/miniM5os.jpg")
    image1.setPosition(0, 0)
    while True:
      image1.show()
      wait(1)
      wait(0.001)
    
    

    I just get a blank black square on the screen.


  • M5Stack

    working fine for me. are sure you did all the steps, manager > upload less than 25 kb image > drag an image placeholder on UI area, select it and choose your uploaded image from the dropdown list? I have occasionally had weird results from certain files. Have you tried other files beside the one your trying to display?



  • @lukasmaximus It will only allow me to upload BMP or JPG but Bmp have to be super compressed.
    Yup followed those steps but just get a black odd shaped box.


  • M5Stack

    @ajb2k3 I had seen a tweet on twitter.

    JPG format needs some conditions.
    ・progressive off
    ・not Matte color

    and use MS paint is no problem.



  • @salty_good said in Images not working:

    @ajb2k3 I had seen a tweet on twitter.

    JPG format needs some conditions.
    ・progressive off
    ・not Matte color

    and use MS paint is no problem.

    i'm on osx and using G.I.M.P



  • Is there a detailed specification for images somewhere?


  • M5Stack

    @ajb2k3 i found out this.

    https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/display#tftimagex-y-file-scale-type

    • JPG images are supported.
      Baseline only. Progressive and Lossless JPEG format are not supported.
      Image size: Up to 65520 x 65520 pixels
      Color space: YCbCr three components only. Gray scale image is not supported.
      Sampling factor: 4:4:4, 4:2:2 or 4:2:0.

    • BMP images are supported.
      Only uncompressed RGB 24-bit with no color space information BMP images can be displayed.



  • @salty_good said in Images not working:

    @ajb2k3 i found out this.

    https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/display#tftimagex-y-file-scale-type

    • JPG images are supported.
      Baseline only. Progressive and Lossless JPEG format are not supported.
      Image size: Up to 65520 x 65520 pixels
      Color space: YCbCr three components only. Gray scale image is not supported.
      Sampling factor: 4:4:4, 4:2:2 or 4:2:0.

    • BMP images are supported.
      Only uncompressed RGB 24-bit with no color space information BMP images can be displayed.

    Ahh Lobo had the specs listed. thanks mate.



  • Working now.


  • M5Stack

    @ajb2k3 Great!!


  • M5Stack

    Is there a good tool in GIMP for compressing image files? @ajb2k3 I tried without success in photoshop before, perhaps its there but I don't know. It would be better however to have an open source solution such as gimp



  • @lukasmaximus some formats gimp can compress, others need understanding of the file formats.


Log in to reply
 

Looks like your connection to M5Stack Community was lost, please wait while we try to reconnect.