Thanks to visit codestin.com
Credit goes to github.com

Skip to content

adafruit_imageload + PNG #103

Open
Open
@10der

Description

@10der

hi!
I have a png file (source here https://developer.lametric.com/content/apps/icon_thumbs/52160)

Image

bit_depth=2

import board
import displayio
import rgbmatrix
import framebufferio
import adafruit_imageload

displayio.release_displays()

matrix = rgbmatrix.RGBMatrix(
    width=64, bit_depth=2,
    rgb_pins=[board.GP2, board.GP3, board.GP4, board.GP5, board.GP8, board.GP9],
    addr_pins=[board.GP10, board.GP16, board.GP18, board.GP20],
    clock_pin=board.GP11, latch_pin=board.GP12, output_enable_pin=board.GP13,
    doublebuffer=True)
display = framebufferio.FramebufferDisplay(matrix, auto_refresh=True,rotation=180)

display.rotation = 0

g = displayio.Group()
b, p = adafruit_imageload.load("images/w-rainy.png")
t = displayio.TileGrid(b, pixel_shader=p, x=20, y=10)
g.append(t)

display.root_group =  g

while True:
    pass

Image

some changes....
bit_depth=6

import board
import displayio
import rgbmatrix
import framebufferio
import adafruit_imageload

displayio.release_displays()

matrix = rgbmatrix.RGBMatrix(
    width=64, bit_depth=6,
    rgb_pins=[board.GP2, board.GP3, board.GP4, board.GP5, board.GP8, board.GP9],
    addr_pins=[board.GP10, board.GP16, board.GP18, board.GP20],
    clock_pin=board.GP11, latch_pin=board.GP12, output_enable_pin=board.GP13,
    doublebuffer=True)
display = framebufferio.FramebufferDisplay(matrix, auto_refresh=True,rotation=180)

display.rotation = 0

g = displayio.Group()
b, p = adafruit_imageload.load("images/w-rainy.png")
t = displayio.TileGrid(b, pixel_shader=p, x=20, y=10)
g.append(t)

display.root_group =  g

while True:
    pass

Image

so. my question is - what I am doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions