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

'braille' render style #59

Open
4 tasks
AnonymouX47 opened this issue Jun 26, 2022 · 0 comments
Open
4 tasks

'braille' render style #59

AnonymouX47 opened this issue Jun 26, 2022 · 0 comments
Assignees
Labels
braille Related to the 'braille' render style enhancement New feature / Improvement suggestion or request planned Planned feature (should be removed as soon as implementation starts)

Comments

@AnonymouX47
Copy link
Owner

AnonymouX47 commented Jun 26, 2022

Branches off #57

This render style is based on three major things:

  • Unicode braille patterns (+U2800 to +U28FF)
  • Lightness of an image pixel

Progress:

  • Sizing
  • Rendering
  • CLI integration
  • TUI integration

Initial idea

  • The image is resized to a resolution of two pixels per cell.
  • There are 5 levels of value (greyness), 0 to 4, each represented by the same number of dots.
  • Each pixel maps to an integer which is an inclusive-OR combination of the bits representing each dot, based on this numbering:

dots

  • The integers for the two pixels in each cell are OR-ed to get an integer for the cell.
  • The integers are stored in an array, whose size is the rendered size of the image.
    • For this, I'm plan to use array.array with 8-bit integers for better memory management.
    • The pixels will be iterated over in a flattened row-major order, while mapping each pixel to the corresponding array index.
  • The integers are then converted to the code points for the corresponding symbol.
    • Zeros will be represented by blanks instead of +U2800 (saves a few bytes per occurrence 🌚)

Any suggestions are always welcome. 😃

@AnonymouX47 AnonymouX47 self-assigned this Jun 26, 2022
@AnonymouX47 AnonymouX47 added enhancement New feature / Improvement suggestion or request lib Related to the library (Not to be used anymore) cli Related to the image viewer's CLI (Not to be used anymore) tui Related to the image viewer's TUI (Not to be used anymore) text Related to the interface common to text-based render styles planned Planned feature (should be removed as soon as implementation starts) braille Related to the 'braille' render style and removed text Related to the interface common to text-based render styles labels Jun 26, 2022
@AnonymouX47 AnonymouX47 added this to the 0.7.0 milestone Feb 23, 2023
@AnonymouX47 AnonymouX47 removed lib Related to the library (Not to be used anymore) cli Related to the image viewer's CLI (Not to be used anymore) tui Related to the image viewer's TUI (Not to be used anymore) labels Apr 16, 2023
@AnonymouX47 AnonymouX47 removed this from the 0.7.0 milestone Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
braille Related to the 'braille' render style enhancement New feature / Improvement suggestion or request planned Planned feature (should be removed as soon as implementation starts)
Projects
None yet
Development

No branches or pull requests

1 participant