If you’ve ever converted an image to GIF and restricted its color table to 256, you effectively employed the Floyd–Steinberg dithering algorithm. For thermal printers – where the background is typically white and black is probably your only ink color – the challenges are different but you can still achieve remarkable results. Thankfully Pierre Muth walks through the process, all stemming from his Free Beer Selfie project.
To print pictures on thermal paper with reasonably good rendering, they should be converted according the printer limitations. It’s quite simple, it can be printed only black pixels (and whites as the paper is usually white).
As receipt thermal printer use paper roll, there is virtually no image length limit. If we want to convert on the fly the image and strait print it, we cannot rely on a fixe full image sized buffer. That’s why I experimenting conversion algorithm based on Floyd-Steinberg, but with only a small rotating buffer. The size of this ‘line’ buffer could be as small as a line size plus one.
Other than the code itself, I try to explain the principle with this Gif :
Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground” – Adafruit’s Apps!
Maker Business — TechShop is closed, files bankruptcy
Wearables — Get concrete solutions
Electronics — Are you grounded?
Biohacking — Learning to See with Sound
No comments yet.
Sorry, the comment form is closed at this time.