The fonts used by us day to day are not specifically designed for printing images. In order to improve the result of character art, custom font is a doable solution, as proved by BE256 and BE512 fonts.
The highest resolution that chafa supports is 8x8 according to the bitmap. There are 2^64 possible combinations, but the whole Unicode table is not enough for that. However, my bold assumption is that most solutions in the space formed of 2^64 combinations are useless.
To find out the most useful N patterns in this space, we can take advantage from machine learning.
The proposed procedure for creating such custom font looks like this:
-
sample M random crops (in ratio w=1:h=2) from an image dataset
-
turn the M crops into binarized bitmaps using histogram and downsample to 8x8
-
find N cluster centers in the space by leveraging Kmeans algorithm, with the M (64x1) binaryzed vectors as the dataset.
-
convert the N vectors into C bitmap header and SVG plots.
Highlight:
-
Best resolution.
-
Easy to code. Automatic font and C code generation.
-
I don't know what glyph is good for printing character art, but the algorithm can figure it out.
Assignee: myself
The fonts used by us day to day are not specifically designed for printing images. In order to improve the result of character art, custom font is a doable solution, as proved by
BE256andBE512fonts.The highest resolution that chafa supports is 8x8 according to the bitmap. There are 2^64 possible combinations, but the whole Unicode table is not enough for that. However, my bold assumption is that most solutions in the space formed of 2^64 combinations are useless.
To find out the most useful
Npatterns in this space, we can take advantage from machine learning.The proposed procedure for creating such custom font looks like this:
sample
Mrandom crops (in ratio w=1:h=2) from an image datasetturn the
Mcrops into binarized bitmaps using histogram and downsample to 8x8find
Ncluster centers in the space by leveraging Kmeans algorithm, with theM(64x1) binaryzed vectors as the dataset.convert the
Nvectors into C bitmap header and SVG plots.Highlight:
Best resolution.
Easy to code. Automatic font and C code generation.
I don't know what glyph is good for printing character art, but the algorithm can figure it out.
Assignee: myself