5 ms·
Family Photos vs 256 Kb RAM
- ladberg 3y agoLooks nice, you might get also want to try out error diffusion dithering for a better result.
- delta_p_delta_x 3y agoOP is using Berkeley Mono[1]—first time I've seen a paid typeface on a blog. [1]: https://berkeleygraphics.com/typefaces/berkeley-mono/ https://berkeleygraphics.com/typefaces/berkeley-mono/
- pacifika 3y agoGreat read.
- londons_explore 3y agoWorth noting that many of these low spec screens allow you to read pixels back. Ie. you can write pixels direct to the screen (one at a time, or sometimes in blocks), and use the screen itself as your framebuffer. Some screens then have a "go" command that will do the actual refresh when you say so. If you so wish, you can use the screen itself as scratch space for code, data, or partially rendered stuff and the user won't see it. Often to find out about this stuff you'll need to go deep into the datasheets - you probably won't find the supplied libraries cover it. I think screen manufacturers do this because they need to have a framebuffer anyway (depending on the screen technology), and they want devices to be able to use their big screens even if they have tiny microcontrollers.
- londons_explore 3y agoIt's common for the lowest power sleep mode of a chip to not maintain RAM. That means whenever you sleep(1 minute) in the code, the system gets entirely restarted. Yes, it's inconvenient, but the benefit is you can sleep for years on a tiny battery. As a programmer, all you need to do is save a few flags of state to persistent memory - eg. EEPROM, and then at startup check those flags to return to whatever task you should be doing. You should check how often you'll be doing this - because EEPROM typically can only be programmed 1000 - 100,000 times in the lifetime of the device. So you might need a cleverer scheme where the first byte of eeprom is a pointer to another place where you store the actual state. Whenever the area of memory where you store the state starts to fail, you change the pointer to a new location.
- mmoskal 3y agoThere are often some RTC registers that get preserved during standby, so you can use that instead of flash or EEPROM.
- systems_glitch 3y agoMain reason for the 56 bytes or whatever above the clock and calendar register :P
- whiskers 3y agoContext: I'm the CEO of Pimoroni who make this product. I feel like something is missing here but I don't know what. Our examples show large JPEGs being loaded in MicroPython no problem. For example this one from our examples is 100kB: https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/examples/inky_frame/image_gallery/600x448/jwst1.jpg https://github.com/pimoroni/pimoroni-pico/blob/main/micropyt... During testing I worked with many images that were larger than that and never ran into issues either. I think the examples provided are pretty clear and demonstrate how to use the product reasonably. We focus on MicroPython because the C++ SDK for connectivity is pretty gnarly for most people to work with - it is our intention you should never have to leave MicroPython to use this product. No idea what the battery issue could be but I've never heard of any problem like that before and we've shipped thousands of this product over the past year. We'd be happy to get the unit back and test it for you if you want - or just replace it! Please drop me a line if you want to discuss these issues further and I'll do my best to help!
- pwg 3y ago> Our examples show large JPEGs being loaded in MicroPython no problem. For example this one from our examples is 100kB: A 100kB JPEG is hardly a "large" JPEG in 2023. From the linked sales page (https://shop.pimoroni.com/products/inky-frame-5-7?variant=40048398958675 https://shop.pimoroni.com/products/inky-frame-5-7?variant=40...) the first line of the description states: "A large Pico W powered E Ink® photo frame ..." From this, many are going to assume that they can simply load JPEG photo files from their cell phone and/or camera directly onto the device. JPEG photos from my cell phone range anywhere from 1Meg to 7-8Meg depending upon the scene being photographed. All of those photos begin at a compressed size substantially larger than 256Kbyte. This is the size JPEG that someone is going to think that a "photo frame" can process and display. Additionally, the pixel resolution of the e-ink is stated as "600 x 448 pixels" (same sales page). Again due to the "photo frame" advertising, even if someone took their JPEG photos and scaled them down to 600x448, they would not likely also quantize to 7 colors at the same time (unless your docs give them very clear instructions to do so somewhere). So they would end up with a RGB 600x448 image, and 600 * 448 * 3 is 806,400 bytes just to hold the uncompressed bitmap from a JPEG of that pixel resolution and 3 bytes per pixel. That size is a bit over three times the amount of RAM quoted for the PI (256kB).
- sandos 3y agoI wonder how this differs from inkplate. I bought a inkplate 2 just for fun and received it yesterday, and I was flabbergasted at how long it took to clear the screen. I mean it flashes the screen well over 20 times... I can't imagine thats really required. I just want to basically display some temperatures from my Home Assistant instead of from my standard wireless thermometer, on a bigger display.
- userbinator 3y agoYou cannot turn this buffer off, probably because writing the stream of bytes into the eInk screen directly is a very nich use case. Is it? IMHO that's one of the biggest advantages of EPDs like eInk --- you don't need a framebuffer, since the display itself is a "write-only memory" and only needs lines shifted into it. On the other hand, I suspect EPD companies try to keep the low-level details (like driving waveforms) secret because that's a large part of their IP. They want to be able to sell controllers for them too. The most unfortunate part is that line-based JPEG decoding and even downscaling is a solved problem, but the bloat of today's software and comparatively limitless computing resources seems to have lead us to forget how to write software efficiently.
- braunboffel 3y ago> On the other hand, I suspect EPD companies try to keep the low-level details (like driving waveforms) secret because that's a large part of their IP. They want to be able to sell controllers for them too. Could you share what evidence this is based on?
- JC770 3y agoThat seems good,Good job!
- Thorrez 3y agoDoes cranking the compression down not get you small enough? I think cranking the compression down can get the image to a very small file size (at the expense of looking terrible).
- RBerenguel 3y agoI love my “old” Inky Impression, just to add some positivity. Just a few days added some new images and posted pictures on Twitter: https://twitter.com/berenguel/status/1662857260043829250 https://twitter.com/berenguel/status/1662857260043829250
- bitbank 3y agoThese are the kinds of issues I've been working on solving with my code libraries. My JPEG decoder only needs about 22K of RAM and my e-ink code can work incrementally to write the image in strips. https://github.com/bitbank2/JPEGDEC https://github.com/bitbank2/JPEGDEC https://github.com/bitbank2/OneBitDisplay https://github.com/bitbank2/OneBitDisplay Let me know if I can help...
- gadgetoid 3y agoIt takes some time to decode, but I can grab- for example- this 259k JPEG: http://placekitten.com/3840/2160 http://placekitten.com/3840/2160 And display it from the microSD card with this code: https://gist.github.com/Gadgetoid/0b8e352e377135d743338c9483178c01 https://gist.github.com/Gadgetoid/0b8e352e377135d743338c9483... As more or less demonstrated by this example: https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/examples/inky_frame/inky_frame_placekitten.py https://github.com/pimoroni/pimoroni-pico/blob/main/micropyt... Decoding is done via Larry Bank's JPEGDEC: https://github.com/bitbank2/JPEGDEC https://github.com/bitbank2/JPEGDEC It uses roughly 20k RAM to provide the necessary buffers both for decoding JPEGs into blocks which are passed to a drawing routine that handles copying the data into the display RAM buffer (on our larger Inky display this is backed by PSRAM). I don't believe there's a hard limit to the size of the JPEGs you can display. The main bottlenecks are decoding time and the relatively limited scaling options: FULL, HALF, QUARTER, EIGHTH. This aside, the authors solution is actually quite elegant. As long as you have control over the image pipeline there's no real reason to encumber the device with handling large (both in bytes and pixel dimensions) files. You'll also get much better dithering results writing your own routine to convert files from JPG to the raw 4-bits per pixel format for the display. Our built-in dithering is just a plain ordered dither matrix and, while quaint and retro, it leaves much to be desired visually. If you're trying to use a public API you can also make GitHub actions automate the whole image conversion process and publish the results to GitHub pages. This works great for, for example, the daily XKCD, serving both to reformat the strip for the display, credit the author, extract the "alt" text and avoid excess requests to the origin. Eg: https://pimoroni.github.io/feed2image/xkcd-800x480-daily.jpg https://pimoroni.github.io/feed2image/xkcd-800x480-daily.jpg. Though the astute will notice I still opted for jpeg in this case.
- sgerenser 3y agoCool use case. The kerning on that alt text would drive me crazy though.
- tuukkah 3y agoRegarding slowness, are there no better primitives available here than setBitByIndex and set_pixel? You end up doing lots of calls per pixel, reading bytes, modifying some bits in them, writing the bytes back over and over. For example, if you worked on monochrome bitplanes (8 pixels per byte) for each of R, G and B, you would handle 8 pixels at a time by just writing the 3 bytes. IFF ILBM is a file format (supported e.g. by ImageMagick) for sharing such image data: https://en.wikipedia.org/wiki/ILBM https://en.wikipedia.org/wiki/ILBM
- vool 3y agoLooks like Dunmore head (Kerry, Ireland) in the photo https://www.flickr.com/photos/missus_magik/9982718923/ https://www.flickr.com/photos/missus_magik/9982718923/
- nerpderp82 3y agoSo much effort for what? Precompute the jpeg to eink bitstream and store that directly on flash. Write a program that converts the jpeg to what the eink display protocol wants to recv and store that. Then stream this "image" format directly into the display, problem solved. cat eink.protocol.bin > /dev/eink