Godot Version
`Godot-4’
Question
How would I make this slope transition smoother? The following picture is not what I want.

Probably adjust the collision on the tile so it’s a smooth curve. The collision geometry and the graphics don’t have to be identical.
If you want a script-based solution without changing the geometry, you probably want to sample at the edges of the sprite and average, rather than sampling in the middle. Doing that might involve some shenanigans, though.