stoeckmann / xwallpaper

wallpaper setting utility for X
ISC License
215 stars 14 forks source link

Flat style image look sharp #34

Open fitrh opened 3 years ago

fitrh commented 3 years ago

20210610_030207_full Take a look to the planet object, the circle look sharp compared to feh with the same image 20210610_030154_full Is this expected ? or did i miss something ? i use xwallpaper with --zoom flag

stoeckmann commented 3 years ago

It's not expected, but I am not surprised either.

While xwallpaper uses pixman for processing of images, feh uses imlib2. There is no feature to blur or anti-alias images with pixman -- although filter and dither are possible.

I doubt that I can do much about this. But it would be nice if you can give me a link to the original wallpaper and your output of xwallpaper --debug --zoom so I know what kind of resolution you use. Maybe there is something that can be done about the filter settings.

By the way, if you use hsetroot for testing, chances are that you see this sharp output as well. Just like feh, hsetroot uses imlib2 but you can modify the imlib2 settings on the command line.

fitrh commented 3 years ago

Oh my bad, i did not look into the source code before and i don't know much about pixman.

By the way, this is the output of xwallpaper --debug --zoom

loading Earth & The Satelite.png
output detected: VGA1, 1366x768+0+0
(randr) screen dimensions: 1366x768+0+0
reusing atom pixmap (1366x768)
composing Earth & The Satelite.png for VGA1 (area 1366x768+0+0) (mode 6)
xcb image (1366x768) to VGA1 (1366x768+0+0)
put image request parameters:
maximum request length allowed for server (32 bits): 4194303
maximum length for row data: 16777188
length of rows in image: 5472
maximum height to send: 3066
put image (1366x768+0+0) to VGA1 (1366x768+0+0)

I can't get where I got the image from, but this image gives the same result.

stoeckmann commented 3 years ago

Thank you for supplying an example image. I can easily see the effect and comparing it with feh and hsetroot now.

Unfortunately I have no solution yet. I can adjust the filter with pixman to use a gaussian kernel actually. But to get a result comparable with feh and hsetroot, xwallpaper becomes veeery slow. It is actually the kind of performance you get when opening that file with chromium. My assumption is that it somewhere uses pixman through cairo as well.

So right now I can only recommend to a) scale the image down so the "best" i.e. bilinear filter of pixman already takes effect or b) use feh or hsetroot. I have to admit that imlib2 does a great job here.

When I have a proper solution or when I dived deeper into imlib2 and cairo internals, I'll give an update. :)

fitrh commented 3 years ago

Thank you, actually i use xwallpaper because it's performance, maybe i have to dig deeper about pixman