-
Notifications
You must be signed in to change notification settings - Fork 39
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
Lowered image quality #54
Comments
+1, same issue here. Using Arch and swappy-git |
There is no intentional compression in the code as far as I can see, just something is wrong with size calculation... Possibly depending on screen scale. Mine is
The resulting image is
Now the saved picture has smaller size, |
Yes indeed, most likely related with #56. Thanks for reporting this. I'm gonna try to see if I can finally have proper High DPI support. |
@Hermitter @maximbaz I believe I finally cracked it. Can you build the latest master and let me know your feedback? I've tested it with large and small images, as well as higher scaled display on my monitor (which is essentially the equivalent of a large image) and it seems to work well. The final image / buffer should be the same resolution as the original image. If that works, I'll release an official release as I'm pretty sure many users will want that. |
Thank you @jtheoof! This is definitely much much better now, it doesn't look "low-res" anymore, at what's most important, when I save the image, it is being saved with the correct resolution 🙂 Just a small thing that I wanted to confirm with you: The image inside swappy is still a bit smaller than reality is when I open a large image (here swappy is under waybar): And larger than reality is when I open a small image (again swappy is under waybar): Is this actually by design, and you are trying to make the swappy window a certain size on the screen? I can see benefit in this for example when I make screenshot of the entire screen, then swappy can still fit it for me, and of course in that case I very much like that the image inside swappy is a bit downscaled. But when I open a small image, is it also desirable to make it intentionally bigger? |
Thanks for fixing this @jtheoof! I'm having trouble compiling from source on Fedora, but it seems to be working looking at the post above. |
Yep there is just one edge case that @maximbaz mentionned that I need to iron out. |
@maximbaz I understand a bit better what is happening in your case. You are right, the app behaves properly for large images, but somewhat more oddly for small images on scaled display. The image swappy receives (in your case) has 2.5 more pixels than what is represented in the captured image. (so far nothing new, it's what high dpi is all about right?). The problem is that swappy doesn't know anything about your scaling wayland value. I tried to stay far away from that as much as possible and let gtk/gdk handle itself. So all swappy knows is the size of the image it received and the size of the monitor (to lower the sized of the gtk window if the image gets too big). So in your case, the captured slurp is small enough to not hit any window threshold and swappy displays it "full size" (as it receives) which is 2.5 bigger than what you captured (relative to scaling). If you simply use At this point, a possible fix would be to introduce the wayland monitor scaling factor (what I've been trying to avoid) but it wouldn't even fix your use case 😢 The reason is because you are using a floating point value for scaling See: So if I use the tools at my disposal, (mostly the GDK function), it will still not scale the image properly and you'll get a window size different from what you expect. So at this point I'm not sure I can fix that issue cleanly. One way to alleviate the issue would be to implement #57. (Kind of like how Eye Of Gnome does it). But it's a lot of GTK work to make it happen and I don't want to invest that much time on it for the moment. I'd prefer to ship a new version with this minor inconvenience and worry about it in another issue/release. Does it make sense? |
Very interesting analysis, thanks for sharing! Yeah it makes total sense, to be honest it's very minor thing, I wouldn't worry about it at all. Let's ship the next release! 🎉 🚀 |
Is there a way to adjust the quality of the final image? Swappy seems to always lower it, regardless of any edits I make.
swappy
(810x649)original
(1270x1019)The text was updated successfully, but these errors were encountered: