Send Images to Your Terminal With Rich Pixels
[darrenburns]’ Rich Pixels is a library for sending colorful images to a terminal. Give it an image, and it’ll dump it to your terminal in full color. While it also supports ASCII art, the cool part is how it makes it so easy to display an arbitrary image — a pixel-art rendition of it, anyway — in a terminal window.
How it does this is by cleverly representing two lines of pixels in the source image with a single terminal row of characters. Each vertical pixel pair is represented by a single Unicode ▄ (U+2584 “lower half block”) character. The trick is to set the background color of the half-block to the upper pixel’s RGB value, and the foreground color of the half-block to the lower pixel’s RGB. By doing this, a single half block character represents two vertically-stacked pixels. The only gotcha is that Rich Pixels doesn’t resize the source image; if one’s source image is 600 pixels wide, one’s terminal is going to receive 600 U+2584 characters per line to render the Rich Pixels version.
[Simon WIllison] took things a step further and made show_image.py
, which works the same except it resizes the source image to fit one’s terminal first. This makes it much more flexible and intuitive.
The code is here on [Simon]’s tools GitHub, a repository for software tools he finds useful, like the Incomplete JSON Pretty Printer.
Riescono a rigirare qualsiasi cosa a loro vantaggio, temo siano imbattibili.
Nel Regno Unito sono necessari uno "scioglimento del Parlamento" e un "cambio di governo". Lo ha detto Elon Musk in videocollegamento col palco della manifestazione organizzata dall'estrema destra a Londra. "Non si può: non abbiamo altri quattro anni, o quando ci saranno le prossime elezioni, è troppo tempo. Bisogna fare qualcosa", ha dichiarato il tycoon riferendosi all'esecutivo laburista di Keir Starmer con cui in passato è entrato più volte in polemica. Ha poi dichiarato che "la sinistra è il partito della violenza e dell'omicidio", riferendosi all'assassinio di Charlie Kirk negli Usa.
rainews.it/articoli/2025/09/lo…
Londra, in 110mila alla manifestazione anti-immigrati. Invocano le dimissioni di Starmer
La convocazione è arrivata dall'attivista di estrema destra Tommy Robinson: alla manifestazione fa da contraltare un evento promosso da un'organizzazione antirazzistaRedazione di Rainews (RaiNews)
Poliversity - Università ricerca e giornalismo reshared this.
АидяёА ЦZ
in reply to Max 🇪🇺🇮🇹 • • •Max 🇪🇺🇮🇹 likes this.