Closed johnd0e closed 2 months ago
The size issue is probably #211. There's a test binary there too. The aspect issue is #212, I think, but that one needs some work still. Shouldn't be too long.
I think this is fixed now. It'll be in the next release. Thanks for reporting it!
I think this is fixed now. It'll be in the next release.
Now the image has proper size, but still distorted a bit. Too narrow.
Now the image has proper size, but still distorted a bit. Too narrow.
Could you attach the source image, plus a screenshot showing how it's displayed in the terminal and the command line you used? I'll take another look.
Source 1024*1024:
Appearance in terminal (~= 842*1094):
Command: chafa -f sixels picture.jpg
Important! Font: Victor Mono
With other fonts I see other aspect ratios, e.g.:
@johnd0e If you're using Windows Terminal, the behavior you're seeing is by design. It's intended that a given sixel image will occupy the same number of cells, independent of the font or font size that is in use at the time. For example your 1024x1024 image will always occupy a little over 102 columns and 51 rows. If your font has an aspect ratio that is significantly different from 2:1, it's expected that it would appear somewhat distorted.
If you're using Windows Terminal, the behavior you're seeing is by design.
Ok, I believe that it is useful for some use cases. But not for others.
Shouldn't then the "correct aspect ratio" be implement as an option?
Perhaps CSI 14 t
and CSI 18 t
can give the proper value?
Shouldn't then the "correct aspect ratio" be implement as an option?
That's not something I'm personally interested in implementing, but you're welcome to request that feature on the WT issue tracker.
Perhaps
CSI 14 t
andCSI 18 t
can give the proper value?
CSI 14 t
has to return the emulated pixel size, otherwise software that relies on that to calculate the cell size won't work.
Sounds like this is working to its full potential. I'll close the issue, but feel free to keep discussing (although, as James points out, it'd likely be more productive in the WT tracker). Thanks!
@hpjansson Is it possible to force specific aspect ration with command line option?
@johnd0e You can set the output size with -s
and add --stretch
to fill the dimensions exactly. In theory, you should also be able to use --font-ratio
, but I think I broke it in one of the recent releases.
In theory, you should also be able to use --font-ratio, but I think I broke it in one of the recent releases.
That's right, it's broken(
Chafa version 1.14.2, Windows
Outputs images that are too narrow. And with sixels image is too small, perhaps that is wrong too.
sample.zip