-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Reported pixel size of cell incorrect. #18460
Comments
We'd need to see the source of test_sixel.py or the actual output that it produced to determine where the problem is, but the most likely explanation is that the pixel aspect ratio is set to 2:1, since that's what Sixel uses by default. |
Ok, I can provide the ansi that produced the image, but I'll use a smaller image for convenience (40 pixels high):
Uh, hopefully that pastes ok. (I think the beginning and ending control characters didn't paste actually) |
The aspect ratio is declared as part of the image. One way of doing this is by using the raster attributes command (the part starting with
It can also be declared in the first parameter value, although that's less obvious - the value
If you don't set the aspect ratio in either of those places, it defaults to 2:1. That was the only aspect ratio supported by the first Sixel terminals, so later models kept that as the default for backwards compatibility. Regardless of how you choose to set the aspect ratio, I would also recommend you set the second parameter to Also note that the dimensions you've declared for the background are 40 wide and 80 high, which I suspect is the reverse of what you intended. |
Thanks for the explanation! This does fix everything! The second parameter was determined by the image not having any transparent pixels. I've read somewhere that some terminals are much slower with P2=1, but maybe that's not true. Anyway, I'm satisfied and this can be closed. |
Thanks all! |
Windows Terminal version
1.22.3232.0
Windows build number
10.0.22631.0
Other Software
No response
Steps to reproduce
I can provide the sixel ansi to produce this image if needed, but otherwise output some sixel image and count the actual number of lines used in terminal.
Expected Behavior
Expect a 100 pixel tall sixel image to cover 5 lines in the terminal if pixel geometry is (20, 10)
Actual Behavior
Related to #17504
Querying pixel size of cell returns (20, 10) as mentioned above (here, in python):
but printing an image that is 100 pixels high, say, uses 10 lines in terminal (expected 5 lines, or 20 pixels high per line):
I've printed line numbers over the image to help show this.
The text was updated successfully, but these errors were encountered: