hsetroot
hsetroot copied to clipboard
imlib2 pixel skewing
sorry for the title as I don't know what to name it at the moment :D
I have being running for a long time in a script
hsetroot -addd "$(rndcolor)" $(rndistance) -addd "$(rndcolor)" $(rndistance) -gradient $(rndangle)
on my 27 and 30 inch monitor, and when distance gets > 10 and angle > 30 the result gets like this. Now on my spunky new 4k; no matter less or more distance & angle it always looks skewed?
Edit : See next post..
I'm sorry, I have no comparison here.
What is it you're expecting to happen?
The distance is ignored for the first add, it's always 1. Given you're using just 2 colors, sounds like you never need a distance > 10, which should work around the problem, right?
But, if I am to fix hsetroot to do the right thing, I need to know what you expect to happen. I don't know where those 2 images come from (which parameters), nor how they should look if the issue was fixed.
Sorry for not being more clear.
Take the bottom image as an example, I expect the white gradient @ 30 angle to black. This works fine on my monitor with resolutions @2560x1600,
testing the same on the other monitor @3840x2160 the output is what I've attached.
I never understod the amount of distance to use, tank you for explaining.
What do you get testing?
hsetroot -add '#ffffff' -add '#000000' -gradient 30
I get this 4 rectagular output.
Ah, thanks, that helps! :)
With hsetroot -add '#ffffff' -add '#000000' -gradient 30
and 1920x1080...
So, what I think it means is that the actual gradient works fine, but once the resolution is above some value, it tries to wrap the pixels somehow. And given the colors in the "weird" area are different from the rest but still using the gradient somehow, it must be the gradient painting code.
OK, that should help :)
Except that looking at the code, it seems like imlib2
is doing all the work :) I'll investigate more, thanks!:)
Yes! thanks for confirming :+1: I was looking for imlib2 bugs that would mention it, but have not found any yet..
More info, imlib_image_fill_color_range_rectangle
just doesn't do the right thing when any width/height is >4096 (#42)
(I suspect imlib_blend_image_onto_image
or imlib_image_copy_rect
to have a similar wrapping issue.)
(wondering if gdk-pixbuf may be the more maintained choice now)
Not shure how helpfull but I switched to this little application some while ago as it does what I wanted to achieve in the first place and the gradient scales correctly over any monitor ive tested.
https://github.com/stevommmm/gbg/blob/master/gbg.c