TerminalImageViewer icon indicating copy to clipboard operation
TerminalImageViewer copied to clipboard

[Feature suggestion] Add a commandline option to retain aspect ratio

Open rubyFeedback opened this issue 1 month ago • 0 comments

Is your feature request related to a problem? Please describe.

Right now I am playing with the two options -h and -w with regard to tiv, such as:

-h 20 -w 500

or just:

-w 500

I seem to get different results. Is the aspect ratio retained? To me it seems as if the aspect ratio is retained because -h 20 -w 500 does not seem to lead to a super-stretched image. This is just me testing though, so perhaps I don't understand these two options.

My proposal is a bit different though.

I think an aspect-ratio or rather scaling, would be neat, for instance:

--scale 50
--scale 50%

To scale to half the size. Any other ratio too, such as:

--scale 150

And the documentation can mention that this is in percentage value.

I only looked at --help output so I have not read the documentation for these options. But perhaps others may also be confused, so a new option that specifically handles aspect ratio and guarantees this, would be neat.

Let me explain my use case.

I have a commandline script written in ruby that shows upcoming exams at universities. I now want to use a small logo of that university. This must be in the same width, so that I can arrange it from top to bottom (exams may be at different universities). So I'd ideally want something like: "make this width in 100px and scale the image back accordingly" or something like that. So, perhaps not just aspect ratio, but being able to guarantee that the yielded ASCII stuff or pixel stuff can fit on the same line, before I then use a newline. (I tried magick six:- before but this seems to always insert a newline, which kind of makes it impossible to show text on the same line; then I remembered TIV and I wanted to see whether I can use it. I can rescale the original image too to optimize for TIV. Right now I am early in my thinking here about showing small banners and logos on the commandline. :))

Describe the solution you'd like

Perhaps --scale or --ratio or --aspectration; and perhaps --width and --height, as well as the ability to specify in px (pixel).

Describe alternatives you've considered

Using something else. :P

Additional context

No response

rubyFeedback avatar Oct 31 '25 12:10 rubyFeedback