Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve fidelity of Mandelbrot TUI render #4

Open
justinhj opened this issue Apr 2, 2022 · 0 comments
Open

Improve fidelity of Mandelbrot TUI render #4

justinhj opened this issue Apr 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@justinhj
Copy link
Owner

justinhj commented Apr 2, 2022

The way the tui rendering of the fractal image is done is I translate the image into blocks of grayscale that match the size of the terminal rows and columns. The grayscales are then scaled again to the 24 graduations allowed in the terminal. The unicode block character is used to draw the image.

fn terminal_render

Some suggestions for improvement... rather than take the overall brightness of the block you would need to choose from a range of different characters that best match the pixels in the image. For example one way would be split it horizontally or vertically if the two halves are vastly difference in brightness.

For example lets say the brightness average is 24 for the top half and 8 for the bottom, you could draw a unicode half block and use the foreground and background colors to get the two different grayscales.

I'm sure people have worked on this before so there may well be a library and/or some ideas on how to do it.

@justinhj justinhj added the enhancement New feature or request label Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant