x
x copied to clipboard
Implement Sixel encoder/decoder support
PR originally implemented by @CannibalVox
Ref: https://github.com/charmbracelet/x/pull/352
Most of this PR changes are just updates on the implementation per requests
Supersedes: #380
@aymanbagabas tested locally and this branch had a regression in performance compared to #380 and #352
ansi/sixel feat-sixel-support-pp - go test -bench=. -benchmem -count 10
goos: darwin
goarch: arm64
pkg: github.com/charmbracelet/x/ansi/sixel
cpu: Apple M4 Pro
BenchmarkEncodingGoSixel-14 4 295443552 ns/op 11894708 B/op 1035163 allocs/op
BenchmarkEncodingGoSixel-14 4 293885792 ns/op 11896036 B/op 1035164 allocs/op
BenchmarkEncodingGoSixel-14 4 304176646 ns/op 11894780 B/op 1035164 allocs/op
BenchmarkEncodingGoSixel-14 4 301280604 ns/op 11894680 B/op 1035163 allocs/op
BenchmarkEncodingGoSixel-14 4 299805969 ns/op 11894680 B/op 1035163 allocs/op
BenchmarkEncodingGoSixel-14 4 301399333 ns/op 11894688 B/op 1035163 allocs/op
BenchmarkEncodingGoSixel-14 4 300609573 ns/op 11894736 B/op 1035163 allocs/op
BenchmarkEncodingGoSixel-14 4 300067042 ns/op 11894688 B/op 1035163 allocs/op
BenchmarkEncodingGoSixel-14 4 300933344 ns/op 11894696 B/op 1035163 allocs/op
BenchmarkEncodingGoSixel-14 4 302264438 ns/op 11894728 B/op 1035163 allocs/op
BenchmarkEncodingXSixel-14 4 297760062 ns/op 43927074 B/op 636054 allocs/op
BenchmarkEncodingXSixel-14 4 298991354 ns/op 43927074 B/op 636054 allocs/op
BenchmarkEncodingXSixel-14 4 298944302 ns/op 43927074 B/op 636054 allocs/op
BenchmarkEncodingXSixel-14 4 301061729 ns/op 43927102 B/op 636054 allocs/op
BenchmarkEncodingXSixel-14 4 299697396 ns/op 43927106 B/op 636054 allocs/op
BenchmarkEncodingXSixel-14 4 302270990 ns/op 43927070 B/op 636054 allocs/op
BenchmarkEncodingXSixel-14 4 299696969 ns/op 43926950 B/op 636052 allocs/op
BenchmarkEncodingXSixel-14 4 302977177 ns/op 43926986 B/op 636053 allocs/op
BenchmarkEncodingXSixel-14 4 301184490 ns/op 43927074 B/op 636054 allocs/op
BenchmarkEncodingXSixel-14 4 300504781 ns/op 43927050 B/op 636054 allocs/op
PASS
ok github.com/charmbracelet/x/ansi/sixel 48.628s