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

Image is displayed squashed depending on the window size (version 9.0.8 only) #1762

Closed
skycommand opened this issue Dec 7, 2023 · 24 comments
Assignees
Milestone

Comments

@skycommand
Copy link

skycommand commented Dec 7, 2023

System information:

  • Windows OS version: 10.0.19045.3693
  • ImageGlass version: 9.0.8.1208

To Reproduce

Steps to reproduce the behavior:

  1. Download the sample image I provided below.
  2. Open it in ImageGlass
  3. Resize the viewing window. Try different sizes. (Edited 2023-12-24)

Actual behavior:

The image could appear horizontally or vertically squashed depending on the size of the window. Not every size squashes the image. But some sizes do. (Edited 2023-12-24)

Expected behavior:

The image must appear as is.

Screenshots:

Screenshot:
Sample image inside ImageGlass

Sample image:
Test

Sample image in ZIP format (to prevent accidental delivery error):
Sample image.zip

Additional context:

  • In the screenshot I provided, please notice the garbled text. Please compare with the sample for a better understanding.
  • This problem doesn't appear in version 9.0.7.

Thanks in advance.

@skycommand skycommand changed the title Image is displayed squashed when the window is maximized or frameless (version 9 only) Image is displayed squashed when the window is maximized or frameless (version 9.0.8 only) Dec 7, 2023
@d2phap
Copy link
Owner

d2phap commented Dec 12, 2023

I'm unable to reproduce this (Windows 11). I will try to check it on Windows 10

@d2phap
Copy link
Owner

d2phap commented Dec 13, 2023

I tried my best to reproduce the issue on VirtualBox but no luck.

Recording.2023-12-13.192818.mp4

@skycommand
Copy link
Author

skycommand commented Dec 14, 2023

I've reproduced the problem in a virtual machine. Here is a video of it.

Furthermore, I've discovered that just resizing the window alone triggers the problem. Here are a few examples:

Sample 1

This image is okay:

1 Okay

This image is horizontally squashed:

3 Horizontally squashed

This image is vertically squashed:

5 Vertically squashed

Sample 2

This image is okay:

2 Okay

This image is horizontally squashed:

4 Horizontally squashed

This image is vertically squashed:

6 Vertically squashed

@d2phap
Copy link
Owner

d2phap commented Dec 14, 2023

Thanks for the details. I followed your guide with different images but still could not reproduce it.

image

Have you tried changing the image interpolation settings if it help?
image

@skycommand skycommand changed the title Image is displayed squashed when the window is maximized or frameless (version 9.0.8 only) Image is displayed squashed depending on the window size (version 9.0.8 only) Dec 14, 2023
@skycommand
Copy link
Author

No. I have not changed that settings. And in the virtual machine, I have changed no setting at all.

If it helps, my display is a 1080p (1920x1080) at 166 PPI.

@LazyBoot
Copy link

I'm seeing the same issues
Notably it only happens at 100% zoom, any more or less and the issue goes away
win10 19045.3803
And it only seems to happen on some window sizes
I did also test multiple interpolation settings, with no change.

@skycommand
Copy link
Author

@LazyBoot Hello. I'm trying to find out why we can reproduce it but d2phap can't. Would you mind telling us what is your screen resolution and PPI?

@LazyBoot
Copy link

I'm not sure how to find my PPI, but resolution is 3440z1440 (100Hz) running at 100% scaling in windows.

@skycommand
Copy link
Author

Thanks a lot. I used this web utility to obtain my PPI: https://dpi.lv/

@LazyBoot
Copy link

Thanks a lot. I used this web utility to obtain my PPI: https://dpi.lv/

ok, I have 110 PPI according to that (34" ultrawide screen)

Also, in case it matters for the bug reproduction, I am running a multi-monitor setup. (2nd is just a 1080p one though.)

@Tomoko1
Copy link

Tomoko1 commented Dec 19, 2023

I have the same issue and I also have a 1080p screen with 166PPI, if that helps. 👍 I'm also on the latest version of Windows 10.

@d2phap
Copy link
Owner

d2phap commented Dec 23, 2023

My PPI is 341, 250%.

I tried changing to image interpolation for 100% scale to HighQualityBicubic. Can you help to test this build?
https://drive.google.com/file/d/1SQiv6sF_5cslfYokEiKTr3NcZjBZ4PFU/view?usp=sharing

@Opicka879
Copy link

My PPI is 341, 250%.

I tried changing to image interpolation for 100% scale to HighQualityBicubic. Can you help to test this build? https://drive.google.com/file/d/1SQiv6sF_5cslfYokEiKTr3NcZjBZ4PFU/view?usp=sharing

I am little bit drunk right now, but it seems to be ok now for me :)

@floppyD
Copy link

floppyD commented Dec 23, 2023

My PPI is 341, 250%.

I tried changing to image interpolation for 100% scale to HighQualityBicubic. Can you help to test this build? https://drive.google.com/file/d/1SQiv6sF_5cslfYokEiKTr3NcZjBZ4PFU/view?usp=sharing

It looks better, but still scaling images needlessly. This 640x480 test image is still being resized to 640x481.

Test image
img1

Test image on IG
img2

Screenshot
new

@LoliMilkQ
Copy link

My PPI is 341, 250%.

I tried changing to image interpolation for 100% scale to HighQualityBicubic. Can you help to test this build? https://drive.google.com/file/d/1SQiv6sF_5cslfYokEiKTr3NcZjBZ4PFU/view?usp=sharing

It looks good.
But the short sides are expanded by 1 pixel, seems like a waste of performance.

@d2phap
Copy link
Owner

d2phap commented Dec 23, 2023

I probably found the root issue. It happened when the drawing location (X, Y) is float number, Direct2D somehow scaled it incorrectly with 1 extra pixel (as reported #1762 (comment)). For example with image 400x400 px:

  • (x, y) = (100, 100): ok no issue
  • (x, y) = (100.5, 100): wider 1px
  • (x, y) = (100, 100.5): longer 1px

So I reverted back to use NearestNeighbor for 100% scaling. Can you help to test this build if it's fixed:
https://drive.google.com/file/d/1WEqziBZCasnowFYBMon-y3mRib50QUET/view?usp=sharing

@LoliMilkQ
Copy link

I probably found the root issue. It happened when the drawing location (X, Y) is float number, Direct2D somehow scaled it incorrectly with 1 extra pixel (as reported #1762 (comment)). For example with image 400x400 px:

* (x, y) = (100, 100): ok no issue

* (x, y) = (100.5, 100): wider 1px

* (x, y) = (100, 100.5): longer 1px

So I reverted back to use NearestNeighbor for 100% scaling. Can you help to test this build if it's fixed: https://drive.google.com/file/d/1WEqziBZCasnowFYBMon-y3mRib50QUET/view?usp=sharing

Not completely valid. If the image a bit larger then the monitor, the pixels will deviate. It's obvious on low resolution monitors.
Is there any way to force the drawing location to integer number?
QQ截图20231223171333

@d2phap
Copy link
Owner

d2phap commented Dec 23, 2023

If the image a bit larger then the monitor, the pixels will deviate

It will be scaled according to your Image Interpolation setting.
The fix applies for 100% scaling.

@LoliMilkQ
Copy link

If the image a bit larger then the monitor, the pixels will deviate

It will be scaled according to your Image Interpolation setting. The fix applies for 100% scaling.

It is 100% scaling.

@d2phap
Copy link
Owner

d2phap commented Dec 23, 2023

@LoliMilkQ I think I didn't really get your comment. Can you send a full screenshot of IG window?

@LoliMilkQ
Copy link

@LoliMilkQ I think I didn't really get your comment. Can you send a full screenshot of IG window?
OK

01
02

sample image.zip

@Opicka879
Copy link

I probably found the root issue. It happened when the drawing location (X, Y) is float number, Direct2D somehow scaled it incorrectly with 1 extra pixel (as reported #1762 (comment)). For example with image 400x400 px:

  • (x, y) = (100, 100): ok no issue
  • (x, y) = (100.5, 100): wider 1px
  • (x, y) = (100, 100.5): longer 1px

So I reverted back to use NearestNeighbor for 100% scaling. Can you help to test this build if it's fixed: https://drive.google.com/file/d/1WEqziBZCasnowFYBMon-y3mRib50QUET/view?usp=sharing

Images where I had issues are ok now.

@d2phap
Copy link
Owner

d2phap commented Dec 28, 2023

Published ImageGlass 9.0.9.1230.

@LoliMilkQ if your issue still persists, I will reopen your ticket #1789

@d2phap d2phap closed this as completed Dec 28, 2023
@dojima
Copy link

dojima commented Oct 2, 2024

This is still an issue on 9.1.8.723 with Windows 10 19045.4651.

It seems to be highly dependent upon the window size and the position of the image within the window. The window size in my sample videos is 479×553. I subsampled the video chroma information to 4:2:0 for compatibility reasons, but hopefully you can still see that the image isn't represented correctly after zooming out and back in. The easiest way to workaround the issue for now seems to be to drag the image to either the left or right edge; doing that seems to correctly align everything.

1.mp4
2.mp4

The test image I'm using can be found here: https://www.rtings.com/tv/learn/chroma-subsampling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants