Admin
December 5, 2023, 7:08am
1
Python image transcoder
CircuitPython Image Transcoder
This tool transcode your monochrome images (black and white) in Gamebuino META Circuit Python style. It recognizes the following image formats: PNG, GIF, JPG and BMP.
This tools is a modified version of original C++ Image Transcoder by Steph, cf Image Transcoder
See more
3 Likes
Hanski
December 6, 2023, 5:06pm
2
Good work! Just to note about one typo: “Circuit Python”
2 Likes
Jicehel
December 12, 2023, 2:42pm
3
You have tested it ? It’s works now with color pictures ?
2 Likes
JMP
December 12, 2023, 3:24pm
4
1 Like
JMP
December 12, 2023, 3:40pm
5
# width 16, height 16, length 1
from gamebuino_meta import waitForUpdate, display, color
spr1 = ( b"\x10\x10"
b"\x00\x00\x00\x00\x00\x00\x00\x00\x08\x20\x04\x40\x0f\xe0\x1b\xb0"
b"\x3f\xf8\x2f\xe8\x28\x28\x06\xc0\x00\x00\x00\x00\x00\x00\x00\x00" )
spr2 = ( b"\x10\x10"
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x40"
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" )
spr3 = ( b"\x10\x10"
b"\x00\x00\x00\x00\x00\x80\x01\x00\x01\x00\x03\x80\x00\x00\x00\x00"
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" )
# example usage
# display scale : 1, 2 ...
SCALE = 2
# display position :
px = 20
py = 10
while True:
waitForUpdate()
display.clear()
display.setColor( color.GREEN ) # Select sprite 1 color
display.drawBitmap( px, py, spr1, SCALE )
display.setColor( color.RED ) # Select sprite 2 color
display.drawBitmap( px, py, spr2, SCALE )
display.setColor( color.ORANGE ) # Select sprite 3 color
display.drawBitmap( px, py, spr3, SCALE )
mrshad
January 3, 2024, 3:56pm
6
Good work! Just to note about one typo: “Circuit Python”