You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've taken a brief look into how this is typically done. Usually people define a ramp of ASCII characters to approximate a gray-scale color ramp. In this sense, we can already dither with ASCII characters using the underlying IndirectArray:
using DitherPunk, TestImages, ImageCore, ImageTransformations
img =testimage("fabio_gray_256")
img =imresize(img, ratio=(1//6, 1//3))
ascii_ramp =split(" .:-=+*#%@", "")
cs =Gray.(range(0, 1, length=10)) # match length of ramp
d =dither(img, FloydSteinberg(), cs)
mat = ascii_ramp[d.index]
for r ineachrow(mat)
println(join(r))
end
which prints the following (make sure your browser window is wide enough):
However, when #60 is implemented, we can go one step further and use font rasterizers like FreeTypeAbstraction.jl to generate tiles from characters, average their color and return ASCII. This would also open up the possibility of supporting colored letters on colored background.
The text was updated successfully, but these errors were encountered:
I've taken a brief look into how this is typically done. Usually people define a ramp of ASCII characters to approximate a gray-scale color ramp. In this sense, we can already dither with ASCII characters using the underlying IndirectArray:
which prints the following (make sure your browser window is wide enough):
This might be worth adding to the docs.
However, when #60 is implemented, we can go one step further and use font rasterizers like FreeTypeAbstraction.jl to generate tiles from characters, average their color and return ASCII. This would also open up the possibility of supporting colored letters on colored background.
The text was updated successfully, but these errors were encountered: