Closed i30817 closed 2 years ago
Actually, i think the color i'm using doesn't matter (black was just less noticeable when i tested in either black background or white because it blended with the image).
So i think there is a off by one bug when applying -t - only for xterm/non sixel terminals.
Might also be a viuer bug.
Here is a test:
#! /usr/bin/env python3
from PIL import Image
import subprocess, io
solid = Image.new('RGBA', (50,50), (0, 0, 0, 255))
t_red = Image.new('RGBA', (50,50), (255, 0, 0, 0))
combined = Image.new('RGBA', (100, 50))
combined.paste(solid, box=(0,0))
combined.paste(t_red, box=(solid.size[0],0))
#for comparasion
combined.show()
#for bug view
with io.BytesIO() as f:
combined.save(f, format='png')
subprocess.run(['viu', '-t', '-'], input=f.getbuffer())
btw, in xterm even without -t the red line appears so now i'm wondering if it's actually -t. As you can see from the first post or from the 'show()' call in the test, the image displays without the line in other viewers. Maybe instead of -t it's earlier in image decoding.
Ah, i think this might be from the interpolation the library is doing when it needs to display on a non-sixel shell? Maybe it isn't taking into account transparent pixels shouldn't blend?
Should i open this bug in viuer instead?
I'm closing this for a bug on viuer.
this image:![thumb](https://user-images.githubusercontent.com/757900/180784630-cbb2dd58-bb5e-4b36-acc4-338cb47f20f6.png)
when saved and used with
viu -t thumb.png
displays a ugly red line in the border of the cover and the transparent part of the image. The image is done programmatically with python pillow code that glues 3 images, first in a side and the two others on top on the right side, and where the images are missing, a transparent area is glued instead.
My 'original transparent' images for the missing images sets a background rgba color of (255, 0,0,0) which is obviously the source of the 'red'.
Should i use (0,0,0,0) always, as a assumption that the alpha is always black for '-t' to work? Btw this has no problems in kitty, it's a xterm problem.