Brian wrote: ↑July 21st, 2023, 8:20 pmCould you post a simple test skin showing the differences in "edges"?
Sorry, my non-native English failed here. What I meant was there is irregular / sinusoidal
color banding when the image is built using a gradient, while when replicating the gradient using lines, the color banding is at least regular, i.e. following
straight lines.
Test skin:
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=3
Background=#@#Background - Gradient.png
BackgroundMargins=2,2,2,2
SkinWidth=600
SkinHeight=600
---Meters---
[Image]
Meter=Image
X=1
Y=1
W=10
H=10
SolidColor=255,0,0,255
Resources (1st: using gradient; 2nd: using lines; 3rd: the .psd source):
Background - Gradient.png
Background - Lines.png
Background.zip
Results (1st: using gradient; 2nd: using lines; best viewed when over a dark theme background, like the one in Notepad++, Photoshop, or Chrome):
Gradient - Bands.png
Lines - Bands.png
The sinusoidal banding can be noticed towards the middle right and towards the bottom of the 1st preview. That being said, I was remembering this the wrong way, it's not Rainmeter's fault, it's Photoshop's, and the scaling done by Rainmeter simply emphasizes it. For some reason, even though I set up the gradient correctly at a 90 degrees angle, the banding turns out sinusoidal and not straight. Anyway, not a big deal, considering there is a solution, at least for small images like in my case (this is my actual scenario).
Brian wrote: ↑July 21st, 2023, 8:20 pmI'm not sure if your saying that internally we can just manually adjust by 1 to account for this.
Something like that, but not quite. Comment out the SkinWidth and SkinHeight lines in the above code, and refresh the skin. What will happen is something like this, that I can see in Photoshop on magnifying stuff:
Background.png
Notice how the W and H of the selected skin area are both 13 pixels. Now, normally, if the posted issue would not be present, I'd go with a background margin of 1 pixel all around, and end up with a nice 10 x 10 pixels red square having the 1 pixel faded bevel (the equivalent of the 0.5 wide bevel mentioned in the other somewhat related thread) adjacent to the square on all sides, giving a total of 12 x12 pixels skin.
However, since a background margin of 1 causes the earlier interpolation (and because using a Shape background requires additional meter toggling and redraws, and because the standard bevel can't be less than 2 pixels wide, i.e. all my possible 3 avenues are cut short by various drawbacks, at least until I'll rework the bevel thing as you advised), I have to use a 2 pixel margin, which increases the skin size to 13 x 13 pixels (not sure why 13 and not 14, since 10 + 2 + 2 = 14, but anyway) of which I can't use the right and bottom 1 pixel wide area seen above between the red square and the dark part of the bevel.
The idea I referred to earlier was to not bother touching the color related stuff in this case (irrespective if you add the interpolation option eventually or not) and just make that part available for drawing, or, even better, not increase the skin size by it to begin with. It seems to me that while the top left part which is reserved for the margin is curiously available for drawing here, i.e. I can put the square at 0,0 and not cause the skin to enlarge from the desired 12 pixels to 13, the bottom right part is not and "steals" pixels from the available drawing area for the user. You can try to set the margin to 10 pixels and place the square at 5,5 to better see what I mean.
Brian wrote: ↑July 21st, 2023, 8:20 pmThe center-most part of the image (the non-BackgroundMargins part) is sampling the entire image instead of just defined rectangle to be drawn.
Ah. This. Indeed.
Brian wrote: ↑July 21st, 2023, 8:20 pmJust some quick testing, use a modified version of your original image:
Very nice showcasing and explanation, I appreciate it. Unfortunately, as you said, the nearest neighbour variant, while producing the desired margin / bevel, will probably pixelate the gradient...
Brian wrote: ↑July 21st, 2023, 8:20 pmThe small modified image might not be the best to demonstrate all the differences in interpolation.
Yes, but it's excellent to demonstrate where those interpolations might not give the expected result.
Brian wrote: ↑July 21st, 2023, 8:20 pmNot sure what other options we have.
Well, there are always options, just not always feasible, of course.
You do not have the required permissions to view the files attached to this post.