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

[suggest] add a option to output original size #1

Open
selaselah opened this issue Apr 24, 2019 · 3 comments · May be fixed by #22
Open

[suggest] add a option to output original size #1

selaselah opened this issue Apr 24, 2019 · 3 comments · May be fixed by #22

Comments

@selaselah
Copy link

img = np.random.randint(0, 255,  [512,512], np.uint8)
imgcat(img) # the output image will auto resized to (372, 372)
@wookayin
Copy link
Owner

wookayin commented May 2, 2019

Can you please elaborate on this? Currently we take the image shape into consideration to determine the height to display image with.

@selaselah
Copy link
Author

the behavior of this package is different with original imgcat.
imgcat of iterm version will display image with orignal size. while this package display image with recomputed size.

the programming interface

def imgcat(data, filename=None,
           width=None, height=None, preserve_aspect_ratio=True,
           pixels_per_line=24,
           fp=None)

It is hard to output original size if some one want to output original size, he must spec pixels_per_line with a 'right' value.

the cmd interface

usage: imgcat [-h] [--height HEIGHT] [--width WIDTH] [-v] [input [input ...]]

imgcat in Python.

positional arguments:
  input            Path to the images.

optional arguments:
  -h, --help       show this help message and exit
  --height HEIGHT  The number of rows (in terminal) for displaying images.
  --width WIDTH    The number of columns (in terminal) for displaying images.
  -v, --version    show program's version number and exit

is even harder. He must get image size in pixel and div with 24.

@Ikatono
Copy link

Ikatono commented May 28, 2024

@wookayin Are you open to a pull request for this?

@liquidcake1 liquidcake1 linked a pull request Jul 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants