Skip to content

transparent pixels aren't elided from output sixel #149

@dankamongmen

Description

@dankamongmen

Hello there! I'm adding libsixel support to Notcurses. Everything's working pretty well, except that transparent pixels (A=255 in RGBA8888) aren't being elided. For the attached image, you can see from oiiotool that we've got alphas of either 0 or 255:

...
    Pixel (37, 98): 112 72 24 255 (0.439216 0.282353 0.0941177 1)
    Pixel (38, 98): 112 72 24 255 (0.439216 0.282353 0.0941177 1)
    Pixel (39, 98): 112 72 24 255 (0.439216 0.282353 0.0941177 1)
    Pixel (40, 98): 112 72 24 255 (0.439216 0.282353 0.0941177 1)
    Pixel (41, 98): 112 72 24 255 (0.439216 0.282353 0.0941177 1)
    Pixel (42, 98): 0 0 0 0 (0 0 0 0)
    Pixel (43, 98): 0 0 0 0 (0 0 0 0)
    Pixel (44, 98): 0 0 0 0 (0 0 0 0)
    Pixel (45, 98): 0 0 0 0 (0 0 0 0)

Here's my native decoder:

2021-03-17-030356_334x165_scrot

Here's libsixel:

2021-03-17-030435_401x233_scrot

All the [0 0 0 0] RGBA values have somehow become red, when ideally they wouldn't be included at all.

Some decision function taking the 8 bit alpha input needs yield a 1 bit output of "include" or "elide". It makes sense to me to make this an attribute of the sixel_dither_t that the user can set (just a threshold, not a callback).

I'm happy to write this up, but wanted to ask first whether I'm missing something, or whether this is a good idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions