!SfJCDXZbMHXkPovtKL:matrix.org

Rust Embedded Graphics

328 Members
Help and chat for embedded-graphics and the wider embedded Rust graphics ecosystem | https://github.com/embedded-graphics/embedded-graphics | https://crates.io/crates/embedded-graphics28 Servers

Load older messages


SenderMessageTime
5 Dec 2024
@scorpion2185:matrix.orgscorpion2185

hello how do you make images like this one

        let ferris = ImageRawLE::new(
            include_bytes!("../ferris.raw"),
            FERRIS_W as u32,
            FERRIS_H as u32,
        );
16:16:21
@scorpion2185:matrix.orgscorpion2185 from https://github.com/dbrgn/pinetime-rtic/tree/master/pinetime-rtic 16:17:03
@scorpion2185:matrix.orgscorpion2185darktable app?16:17:31
@jamesmunns:beeper.comJames Munnshttps://docs.rs/embedded-graphics/latest/embedded_graphics/pixelcolor/raw/index.html has some hints, you could probably generate the raw images using those messages on a desktop or whatever16:18:25
@jamesmunns:beeper.comJames Munns(I haven't done that personally though, so I don't know exactly how to do it offhand)16:19:04
@scorpion2185:matrix.orgscorpion2185is touchscreen support related to embedded-graphics ?16:20:05
@jamesmunns:beeper.comJames Munnsprobably not, embedded graphics just handles drawing16:20:32
@almindor:matrix.orgalmindorit's an interesting question though because you do need a sort of integrated driver for that. I do have one display with touch capabilities, but I never got around to trying to get the touch part working19:07:46
@dngrs:matrix.orgdngrsI did get things to more or less work with an IL-something19:22:37
@dngrs:matrix.orgdngrsbut calibration was ass19:22:41
@scorpion2185:matrix.orgscorpion2185
In reply to @scorpion2185:matrix.org
from https://github.com/dbrgn/pinetime-rtic/tree/master/pinetime-rtic
it's for ^ pinetime
19:50:47
@jamwaffles:matrix.orgjamwaffles

This is code from ages and ages ago so some stuff might've changed but these old docs have an ImageMagick example:

convert image.png -flip -flop -type truecolor -define bmp:subtype=RGB565 -resize '64x64!' -depth 16 -strip image.bmp
20:16:20
@jamwaffles:matrix.orgjamwaffles Also an example for 1BPP images here 20:16:45
@scorpion2185:matrix.orgscorpion2185i found out that gimp can export to .raw20:16:57
@jamwaffles:matrix.orgjamwafflesOh nice, that's a lot easier20:17:28
@scorpion2185:matrix.orgscorpion2185gimp-raw.png
Download gimp-raw.png
20:20:33
@scorpion2185:matrix.orgscorpion2185do i pick BMP style ?20:21:30
@jamwaffles:matrix.orgjamwafflesI don't think so, the order will be wrong and the alpha channel will mess the stride up20:23:46
@scorpion2185:matrix.orgscorpion2185and standard as rgp type?20:24:50
@jamwaffles:matrix.orgjamwafflesYeah20:28:55
@jamwaffles:matrix.orgjamwaffles If you follow the docs through, the byte order and count per pixel is defined by the final colour you end up using, so e.g. an SSD1331 which uses the Rgb565 colour type will need R, G, B totalling 16 bits per pixel 20:30:44
@scorpion2185:matrix.orgscorpion2185with gimp export or convert i get a black screen20:48:53
@9names:matrix.org9names Why not use a BMP file instead? Then you don't have to deal with converting your images into a raw bitstream
https://crates.io/crates/tinybmp
20:49:01
@scorpion2185:matrix.orgscorpion2185let me check that. the os uses a .raw so i tried that20:50:25
@scorpion2185:matrix.orgscorpion2185there some var some maybe something was not specified correctly20:51:57
@scorpion2185:matrix.orgscorpion2185* there some vars maybe something was not specified correctly like i did not update the width or height that it was different20:52:29
@dngrs:matrix.orgdngrsjust black seems like maybe something else is wrong. "wrong raw format" should give you random pixel colors, not black20:53:33
@scorpion2185:matrix.orgscorpion2185 i changed the files used in https://github.com/dbrgn/pinetime-rtic/tree/master/pinetime-rtic without changing the rest. 20:54:17
@dngrs:matrix.orgdngrsmaybe do a hexdump of your raw file20:55:00
@9names:matrix.org9names

I'm going to copy-paste my answer to the last time someone asked for this:

getting imagemagick to export 565 can be a pain. it's easier to use ffmpeg

ffmpeg -i input.png -pix_fmt rgb565 -f rawvideo output_565.raw

check your raw image with https://rawpixels.net/ to verify that it is correct

21:12:14

Show newer messages


Back to Room ListRoom Version: 5