ShaunLawrie / PwshSpectreConsole

👻 PwshSpectreConsole is a PowerShell wrapper for the awesome Spectre.Console library
https://pwshspectreconsole.com/
MIT License
117 stars 7 forks source link

adding Sixel Support to PwshSpectreConsole #50

Closed trackd closed 2 weeks ago

trackd commented 1 month ago

Sixel

image

still needs a bit of work but most things seem to render ok..

need to investigate transparency a bit more.

trackd commented 1 month ago
| Method        | Mean     | Error    | StdDev   | Median   | Gen0      | Gen1      | Gen2      | Allocated |
|-------------- |---------:|---------:|---------:|---------:|----------:|----------:|----------:|----------:|
| ImgToSixelOld | 34.86 ms | 0.693 ms | 1.250 ms | 34.25 ms | 1500.0000 | 1031.2500 | 1000.0000 |   7.57 MB |
| ImgToSixelNew | 27.59 ms | 0.516 ms | 0.483 ms | 27.44 ms |  968.7500 |  968.7500 |  968.7500 |   1.19 MB |

converted it to stringbuilder.. seems alot better :) also refactored the class a bit, it's now broken up into much smaller methods which will simplify when adding gif/animated sixels.

ShaunLawrie commented 4 weeks ago

Most of this code is upstream in https://github.com/spectreconsole/spectre.console/compare/main...ShaunLawrie:spectre.console:main

It's in prerelease atm (just copied the dlls into the repo) and it's full of hacks and visual bugs lol https://prerelease.pwshspectreconsole.com/reference/images/get-spectresixelimage/

image

trackd commented 2 weeks ago

closing this as we broke it out into it's own sixel module and adding the code upstream to SpectreConsole.

will push the non-sixel stuff in a separate pr