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

Terminal Image display has low resolution #5035

Open
Tyriar opened this issue Apr 19, 2024 · 1 comment
Open

Terminal Image display has low resolution #5035

Tyriar opened this issue Apr 19, 2024 · 1 comment
Labels
area/addon/image type/bug Something is misbehaving

Comments

@Tyriar
Copy link
Member

Tyriar commented Apr 19, 2024

From microsoft/vscode#210672

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.88.1
  • OS Version: Mac: Universal Intel silicon

Steps to Reproduce:

  1. imgcat "anyimage.png"

Original image:

download

In VScode terminal

CleanShot 2024-04-18 at 12 08 01@2x

In Iterm2 terminal

CleanShot 2024-04-18 at 12 09 17@2x

@jerch
Copy link
Member

jerch commented Apr 28, 2024

@Tyriar Whats the right way to scale a canvas to operate on real device pixels instead of css pixels? Should that be done on width/height attribute level of the canvas object?

For example - lets say we have a DPR of 2 at hand - where should that "doubled" pixel values go? Would this be sufficent (and the browser deals with the low level stuff on its own):

const canvasObj = ...
// apply real pixel values to canvas (doubled  here)
canvasObj.width = cssWidth * DPR;
canvasObj.height = cssHeight * DPR;
// output is still within the logical css pixels
canvasObj.style.width = cssWidth;
canvasObj.style.height = cssHeight;

// later on during painting:
canvasObj.drawImage(...<metrics here now in real device pixels>...);

Would that already fix things? (Sorry if that question looks dumb to you, but I've never done this DPR correction myself, also I cannot really test it...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/addon/image type/bug Something is misbehaving
Projects
None yet
Development

No branches or pull requests

2 participants