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 SixelImage #1679

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add SixelImage #1679

wants to merge 1 commit into from

Conversation

ShaunLawrie
Copy link

@ShaunLawrie ShaunLawrie commented Nov 12, 2024

fixes #1678

Some discussion in #1671
And more discussion on https://bsky.app/profile/shaunlawrie.com/post/3lao4uw5eos2m

  • I have read the Contribution Guidelines
  • I have commented on the issue above and discussed the intended changes
  • A maintainer has signed off on the changes and the issue was assigned to me
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors
  • The documentation was modified to reflect the changes OR no documentation changes are required.

Changes

Add a first cut of sixel for @patriksvensson to play with.

This is modified source from mine and @trackd's sixel tinkering in https://github.com/trackd/Sixel and PwshSpectreConsole, it's all MIT so free to consume.


Please upvote 👍 this pull request if you are interested in it.

@ShaunLawrie
Copy link
Author

I've left the SPECTRE_CONSOLE_DEBUG env var in there because I found it easier to visualize the dimensions of the sixel data and how they lined up to character cells positioning. When you set that it will render a canvas checkerboard overtop of the sixel data.
image

I used cursor-right control codes to simulate transparent pixels in the canvas which breaks the snapshot tests for canvas rendering. Using those characters could be only under sixel rendering circumstances but I'm not sure how @patriksvensson wanted to reorganize this so they're still broken atm.

@patriksvensson
Copy link
Contributor

I'll take a look at this asap

@phil-scott-78
Copy link
Contributor

I think there might be opportunities for some interesting use cases for the Sixel output independent of ImageSharp. Might be cool if the parsing and building of the ansi was part of Spectre.Console itself with the code to convert an ImageSharp frame being the only code with dependencies on ImageSharp.

@patriksvensson
Copy link
Contributor

@phil-scott-78 Yes, that was my initial idea as well, but quickly realized that it's a pretty daunting task without a library behind it. Open to refactor it out later, and make it available without the ImageSharp library, but for now I think it's ok.

@github-actions github-actions bot added the ⭐ top pull request Top pull request. label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ top pull request Top pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Sixel Support
3 participants