diff options
author | bptato <nincsnevem662@gmail.com> | 2024-09-24 23:25:07 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-09-24 23:55:43 +0200 |
commit | 1c9277343140effcc9eee8845757afd1eed4f4bd (patch) | |
tree | 7a902dc2aebce67ee5749442129176b0683cf60f /adapter/protocol/ftp.nim | |
parent | 0c738c94e14c213562f69ff6e376c19fb0487201 (diff) | |
download | chawan-1c9277343140effcc9eee8845757afd1eed4f4bd.tar.gz |
sixel: support transparency
Sixel can only represent transparency for fully transparent (alpha = 0) and fully opaque (alpha = 255) pixels, i.e. we would have to do blending ourselves to do this "properly". But what do you even blend? Background color? Images? Clearly you can't do text... So instead of going down the blending route, we now just approximate the 8-bit channel with Sixel's 1-bit channel and then patch it up with dither. It does look a bit weird, but it's not *that* bad, especially compared to the previous strategy of "blend with some color which hopefully happens to be the background color" (it rarely was). Note that this requires us to handle transparent images specially in term. That is, for opaque ones, we can leave out the "clear cells affected by image" part, but for transparent ones, we must clear the entire image every time.
Diffstat (limited to 'adapter/protocol/ftp.nim')
0 files changed, 0 insertions, 0 deletions