Replies: 3 comments 2 replies
-
If there's an off the shelf utility to produce raw format images, I haven't found it yet. It might be worthwhile building a tool that targets all of the formats MicroPython's framebuf supports. Note: AIUI a FrameBuf instance can be set up with a width/height/stride and pointed at an existing buffer (your spritesheet) such that it represents the individual sprite without producing a copy of the data. Most (possibly all?) colour LCDs and OLEDs support RGB565 (16bit) "natively", though there are many reasons to work in a reduced colour space (performance, memory restrictions) and E-Ink displays and monochrome LCDs tend to be a world unto themselves. Sometimes you want 24bit (an LED matrix display done right will usually take 24bit and gamma correct that up to 10+ bits per channel.) I "solved" the image conversion problem with custom builds, and bindings into a C PNG decoder (https://github.com/bitbank2/PNGdec) but that's currently not very portable. Just chucking PNG and JPEG files onto a MicroPython device (though even those have caveats) is so much easier than preprocessing images, though there are always tradeoffs. Sorry for the info dump- I've spent way too long mucking about with custom graphic libraries, sprite handling, animation, layering, blending, and so on and so forth. |
Beta Was this translation helpful? Give feedback.
-
There is this on Github: https://github.com/cirquit/UTFTConverter Also, Google Gemini suggests using
However, I haven't tried this yet. |
Beta Was this translation helpful? Give feedback.
-
I made a demo to test the sprite sheets module. Seems to be very responsive. The demo video: And the png image the sprite sheet was generated from: Curt |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a module to extract raw images from a sprite sheets. See code below.
The 'raw' image format has many variations but I can't find an image utility that creates a raw format used by OLED displays (pixel data only in RGB565 format). I'm using a custom python app (img2rgb565.py) to do the conversion. Anyone know of a utility that does this, I use Gimp but have not been able to create a raw file with the correct format.
Do most displays support this image format?
I am using this module on a Pico 2 w which seems to have enough memory to handle the raw images stored in memory.
Curt
Beta Was this translation helpful? Give feedback.
All reactions