-
Hello, i have this image that i want to render on my terminal: So i download and try to render it: curl -sL 'https://veekun.com/dex/media/pokemon/icons/492-sky.png' > shaymin-sky.png
chafa --symbols vhalf shaymin-sky.png But the result seem blurry: I want the output to be pixel-perfect, am i missing something? you guy have any suggestion? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Which terminal are you running? Try one with sixel support, or Kitty, which is supported through its own protocol. Chafa should detect your terminal and use the correct mode automatically, but if it doesn't, there's always the There may still be some blurriness due to scaling. Currently, the only was around that is to prescale the image using nearest-neighbor interpolation. I.e. make the pixels 16x bigger or 32x bigger. Then run You can do the prescaling using something like |
Beta Was this translation helpful? Give feedback.
-
I spent some time trying to tackle this issue as I think I got a reasonable solution: Running:
Note for some small images this doesn't work so well, but for most sprites the above will serve you well. Here is an example of another image with the prescaling done for chafa and comparing it with timg's output: Timg's output with original file: I would love if there was a mode for pixel perfect display in chafa that somehow bypasses the scaling of the dimension into cells. Note looking at the pipeline end to end, the prescaling does cause that pipeline to be slower than timg's pipeline, while also not being as accurate. |
Beta Was this translation helpful? Give feedback.
I spent some time trying to tackle this issue as I think I got a reasonable solution:
I found that
-filter
did some blurring so I wanted to avoid that option and just use-scale
for exact pixel replication.For the following image:
Running just
chafa
:Running:
We get the pixel perfect:
Note for some small images this doesn't work so well, but for most sprites the above will serve you well.
Here is an example of another image with the prescaling done for chafa and comparing it with timg's output:
Chafa w/ prescaling:
Timg's output with original file:
I would love if there was a mode for pixel perfect display in chafa that so…