Skip to content

img2sixel -I appears to be proken #61

@schauveau

Description

@schauveau

I am using libsixel compiled from from git with xterm. That works fine but the -I option of img2sixel (so 15bit true color) is producing some corrupted images. I always assumed that xterm was the problem but then I noticed a similar issue when using sixel2png to decode the output of img2sixel

Here is an example taken from https://upload.wikimedia.org/wikipedia/commons/9/93/CMYK_farbwuerfel.jpg

in

The command is
img2sixel -I IN.jpg | sixel2png > out.png

out

The generated PNG is a valid image but the palette is corrupted. What I also noticed is that images with few colors are correctly rendered by the -I option.

Here is the bash command I used to see the effect of changing the number of colors in the input image (using ImageMagick) and then display the effect of applying img2sixel -I | sixel2png

while read -p "COLORS=" N ; do convert IN.jpg -colors "$N" A.png ; identify A.png ; img2sixel -I A.png | sixel2png > B.png ; convert A.png B.png -append C.png ; display C.png ; done

Remark: The original convert command can be very slow when using more than 200 colors.

Using less than 64 colors should be mostly fine but here is the output obtained using 100 input colors:First the image produced why imagemagick for a palette of 100 and then the output of sixel2png
c

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