Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image is kinda blurry compared to img2sixel #119

Closed
ErrorNoInternet opened this issue Dec 11, 2022 · 2 comments
Closed

Image is kinda blurry compared to img2sixel #119

ErrorNoInternet opened this issue Dec 11, 2022 · 2 comments
Labels
feature New feature or request quality Output quality
Milestone

Comments

@ErrorNoInternet
Copy link

Images displayed by chafa are slightly blurrier than ones displayed by img2sixel (libsixel)
Also, the ones displayed by chafa are a few pixels shorter (in height) compared to the ones by img2sixel I think (not sure if that's actually the case or maybe it's just my eyes). Maybe that's why it's blurrier? See the image below:
image
And the original image:
termtest

Using Konsole 22.12.0

@hpjansson
Copy link
Owner

Hi! Thanks for filing the report.

You're right, it's blurrier. The reason is that Chafa internally handles dimensions as cell extents, not pixels. The image is scaled to fit a certain number of text cells exactly: When I first defined the API, I hadn't considered pixel-perfect graphics (originally it only did ANSI art).

I have ideas on how to fix it, but it requires some API finesse (e.g. how to align the image in the cell extent it occupies -- left, right, center). This issue seems like a good place to track the progress :-)

@hpjansson
Copy link
Owner

I've been working on extending my image library to allow simultaneous scaling and subpixel translation, which will fix the problem once it's done. Of couse it succumbed to feature creep (sRGB! Fast sRGB! More AVX! New tests and benchmarks! Even more AVX!), but it's getting there on my local branch. Arguments for image alignment are also being added (discussion in #140).

@hpjansson hpjansson added quality Output quality feature New feature or request labels Jul 14, 2023
@hpjansson hpjansson added this to the 1.14 milestone Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request quality Output quality
Projects
None yet
Development

No branches or pull requests

2 participants