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

Add support for 16-colour terminals #2

Closed
PK-cod3ch3mist opened this issue Oct 22, 2021 · 2 comments
Closed

Add support for 16-colour terminals #2

PK-cod3ch3mist opened this issue Oct 22, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest-accepted

Comments

@PK-cod3ch3mist
Copy link
Owner

The current generator does not support coloured output for terminals with only 16 colours like Terminal.app and Command prompt in Windows. For these, the only option is black and white ascii-graphics.

  • Add a function that determines colour of individual ASCII characters to be printed while converting the image to 16-colours (4-RGB) space.
  • It will be appreciated if done by using dithering so that the image looks similar to the true colour one.
  • Both solutions using openCV/Pillow library functions or a self implementation of dithering are acceptable

Solutions that sit well with the current code structure, i.e. using options for True-Colour/B&W/4-RGB will be appreciated

@PK-cod3ch3mist
Copy link
Owner Author

Possible solution expectations/guide

What is done

Since the current script can already determine which character to print based on brightness, if you take a HSV (Hue-Saturation-Value) or HSL (Hue-Saturation-Lightness), the current script works out the lightness/value part. This means, once it is determined what the hue and saturation will be, the script can choose the ascii character for the brightness.

What is to be done

So what is needed is a function/algorithm that can map the hue and saturation of 24-bit RGB colourspace to 16 or 8 basic colours (which will then be assigned to characters that map to brightness).

@PK-cod3ch3mist PK-cod3ch3mist pinned this issue Jan 15, 2022
@PK-cod3ch3mist
Copy link
Owner Author

Added support for 8-colour terminals

@PK-cod3ch3mist PK-cod3ch3mist unpinned this issue Apr 3, 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 good first issue Good for newcomers hacktoberfest-accepted
Projects
None yet
Development

No branches or pull requests

1 participant