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
imgcat: add option to resample/resize images #3264
Comments
I see you've addressed this in e048410 and #3716 (comment). The options and their defaults look good. The only "odd" thing is the reduction of animated images to a single frame but I guess there're reasons for that. Anyways, an animated image with a resolution above the default maximum should probably be an abomination IMO! I'll test it out later today and get back to you. Thanks. |
That limitation is imposed by the image library: while it can consume certain animated formats, it doesn't offer a to way re-encode them. In addition, the processing time will be non-trivial; it already takes the better part of 1 second to process the image you provided as an example. I consider re-encoding animations to be out of scope for imgcat. The frame is likely the first frame, but that is expressly undefined by wezterm: if you need specific behavior for content that is already out of spec of the terminal, then you will need to be responsible for pre-processing it into the correct parameters ahead of time; the purpose of this resampling is a best effort to show an image that would otherwise not be possible to display. |
Thanks, that's all understandable. I've tested out the options and they all work as described and expected with a couple exceptions: 1. Varying downscale resolutions with the same
|
Is your feature request related to a problem? Please describe.
I have some high-res images (JPEGs and PNGs at least) for which wezterm simply displays nothing (using
wezterm imgcat
) even though the escape sequence is actually emitted.I actually expect this behaviour from any terminal emulator, since
imgcat
transmits the image file content as-is.The following was logged:
So, I understand why.
Describe the solution you'd like
imgcat
should downscale and re-encode high-resolution images before writing the escape sequence.Describe alternatives you've considered
imgcat
could check the image size and emit an error message if it's above the maximum for wezterm.Additional context
Sample image: high-res.jpg (9,000 × 6,357 px)
Every other [reputable] tool I know for displaying images in terminals does exactly what I suggested (i.e downscaling and re-encoding) as a solution.
Personally, I'm not really affected by this and I don't see it as high priority. I'm just concerned about users that might be confused in such situations.
The text was updated successfully, but these errors were encountered: