Question: Is there a modification of simple component-wise barycentric-based interpolation of vertex values (such as colors) that accounts for arbitrary positive non-zero weights assigned to these contributions to skew resulting values to favor stronger contributions (where magnitude equals strength)? If so, how does it work in algebraic terms (or as close to algebraic terms as possible)?
Background: I am working on an image filter that breaks down an image using statistical clustering into a set number of polygons with [3..8] sides using the average color within its area. I thought it would be interesting to use the centers of these polygons as vertices, build a Delaunay triangulation using these vertices, and then re-render the image by interpolating the vertices' colors across the surfaces of the resulting triangles using each vertex's source polygon's area as a weight to skew its contribution. My theory is that this would result in a stainglass sort of look, especially if I then rendered the edges around the paired Voronoi tessellation.
Ideally, what I am looking for is as follows:
- If all the vertices have equal weight, the process will yield identical results to basic barycentric-based contributions.
- If the vertices do not have equal weight, barycentric coordinate values of 0 or 1 will not be changed, but all intermediate values will be skewed to favor vertices with larger magnitudes.
I've tried Googling for a process that works in this way. Probably due to my limited mathematical literacy, I have not found anything close to what I want. If such a method exists, could you explain this process to me so I could implement it in a programming language that supports little more than algebra and select implemented mathematical functions (e.g., Python, Java, C++)?
ccorn's algorithm works! Below are some results from some very basic tests. In each of these pictures, the upper-left corner is red (255,0,0), the upper-right corner is green (0,255,0), and the lower-left corner is blue (0,0,255). Each of these runs represent setting different weights to each of the corners. I will list each of the corners' weights in RGB order (UL, UR, LL).
(1, 1, 1): standard case
(400, 300, 200):
(100, 400, 900):