fecund_font_flounder

Crates.iofecund_font_flounder
lib.rsfecund_font_flounder
version0.2.1
created_at2025-07-01 22:15:36.055584+00
updated_at2025-08-08 08:04:13.921132+00
descriptionFor printing images in the terminal, with fonts
homepage
repositoryhttps://gitlab.com/matra2/fecundfontflounder
max_upload_size
id1734160
size867,735
Mateusz Rajs (matra2)

documentation

README

Fecund Font Flounder

Have you ever wanted to view images in your terminal without using some cheaty, build in, image rendering feature that some terminal have? 'Printing images using only characters' - is that what keeps you up at night?

Well, insomnia no more! Fecund Font Flounder is here to help you with that!

Fecund Font Flounder renders images using the characters present in many fonts, such as braile characters, half block characters or by generating a custom font with set of custom characters that work best for given image.

The working principle

Image is loaded, processed and then converted into a sequence carefully chosen characters with foreground and background colors.

Such an image can be generated in three ways:

Method Description + - Emample numbers
Build In Characters Uses characters present in most fonts. No font generation required compatible, simple limited detail 1, 2
Font creation offline Creates predefined set of characters (font) uppon which images can be rendered. more detail, many images can be rendered with predefined font need to install font and use it in terminal, big font file 3, 4, 5
Font creation online Font is generated specifically to be used for this one image best detail, small font file same as above, each image requires its own font none yet :c

Examples

Here are some images rendered using the example code provided.

Images in eg. subsection 3 can be regenerated using the following command:

cargo run --example=ex3 path_to_your_image

The command above creates a text file runtime/out_image (and sometimes a font file runtime/out.ttf). When the text of this file is printed to the terminal (which uses the generated font file), the image is rendered.

If using the kitty terminal this can be done with the following command:

./print.sh

1 Half block

The half block character '▀' is present in most fonts. Using this one can render an image with roughly square 'pixels'. Similar can be generated with

Evangelion cover Dan Da Dan shot

2 Braile characters

These are also ubiquitous. Using them one can render an image with more detail. Similar can be generated with

Court of the Crimson King Welcomeeee toooooo the machineeeeeee
Violence Medical Mecanica

3 Custom brailelike characters

To be able to render images with greater detail, one must resort to custom characters. Here we generate a set of custom characters, similar to braile, but instead of 2x3 grid, we use grid of arbitrary size. Additinally, each color of the image is restricted to be one of the colors given by the palette. A dithering effect is also applied.

Court of the Crimson King Panty and Stocking
An idiot Welcomeeee toooooo the machineeeeeee

4 Brailelike with different dithering

Previously, we restricted ourselves to characters that are grid of full and empty cells. But we can go one step further. Every cell can be one of three states: full, empty, or half-filled. The first two states are rendered as before, but a cell in half-filled state is considered as another 2x2 grid, with cells alternating between full and empty. This gives a cool dithering effect.

In this case a palette is also used although a diffedent one.

Crabs by Picasso Cat of a friend
Bee movie Litovel

5 Comodore

Inspired by the Comodore 64. This machine has the unique restriction that every block of 8x8 pixels on the screen must have at most 2 colors.

Crimson Kink again Warhol

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt