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

Interim indexed-color (256-color) Rendering #109

Merged
merged 10 commits into from
Jun 6, 2024
Merged

Conversation

AnonymouX47
Copy link
Owner

@AnonymouX47 AnonymouX47 commented May 30, 2024

  • Implements image rendering using indexed-color SGR control sequences to support terminal emulators without direct-color SGR (truecolor) support.
  • Adds DIRECT and INDEXED render methods for BlockImage.
  • Adds method style-specific render parameter and format spec field for BlockImage.
  • Implements image quantization for text-based render styles.
  • Updates terminal support information.

Resolves #90
Partially addresses #61

Note

This is just an implementation to satisfy demand in the meantime, while we await full resolution of #61.
For this reason, this will only be merged into v0.7.x and not main.

- Add: `TextImage._get_render_data()`, implementing image quantization
  for text-based styles towards indexed-color rendering support.
- Add: `TextImage._XTERM_240_PALETTE_IMAGE`.
- Add: `DIRECT` and `INDEXED` render methods.
- Add: *method* style parameter and format spec field.
- Add: Attributes:

  - `_FORMAT_SPEC`
  - `_render_methods`
  - `_default_render_method`
  - `_render_method`
  - `_style_args`

- Add: `._check_style_format_spec()`.
- Add: *method* parameter to `._render_image()`.
- Change: Update class docstring.
- Add: Use the *method* parameter of `._render_image()`.
- Add: Implement the `INDEXED` render method.
- Fix: Typo in `._get_render_data()`.
- Add: Mention indexed-color support in the requirements.
- Change: Update the list of supported terminal emulators.
@AnonymouX47 AnonymouX47 added block Related to the 'block' render style text Related to the interface common to text-based render styles new New feature implementation labels May 30, 2024
- Fix: Use the non-standard semi-colon-delimited indexed-color SGR
  control sequences, as they're more widely supported than the standard
  colon-delimited counterparts.

Refs: #90 (comment)
@AnonymouX47 AnonymouX47 linked an issue Jun 6, 2024 that may be closed by this pull request
@AnonymouX47 AnonymouX47 merged commit eab7b96 into 0.7.2 Jun 6, 2024
25 checks passed
@AnonymouX47 AnonymouX47 deleted the indexed-color branch June 6, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block Related to the 'block' render style new New feature implementation text Related to the interface common to text-based render styles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: 256-color image rendering for BlockImage
1 participant