Skip to content

Move image displayed with --kitty #442

Answered by LinusDierheimer
tdtooke asked this question in Q&A
Discussion options

You must be logged in to vote

Just to give a little insight on this:

The way fastfetch draws is (and must be) the following:

  • Draw the logo left to right, top to bottom.
  • Go x lines up, where x is the height of the logo
  • Go as left as possible
  • For each line go y right, where y is the width of the logo, then one line down

For this to work properly, fastfetch must know the height of the logo in lines. This is no problem for ascii arts, but tricky for images, as their size is measured in pixels. Terminals provide the following APIs to interop:

  • Width and Height of the terminal window in characters
  • Width and Height of the terminal in pixels

Fastfetch determines the height of the logo, by calculating imagePixelHeight / (te…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tdtooke
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants