Image Blending/Compositing (f(alpha)I_src) (OP) (g(alpha)I_dest) = I_dest where OP = add, minus, etc. The order of operations is important when doing alpha blending. Defintion: image processing = discrete signal processing in 2D Combining images using interpolation - there are 2 methods of interpolation used (Nearest Neighbor and Bilinear) Nearest Neighbor I(x,y) where x and y are float values Round the values to the nearest integer x_r = round(x) y_r = round(y) Then reset the pixel to the rounded value output_value = I(x_r, y_r) Bilinear Interpolation. This is linear interpolation. It is often called a lerp() function lerp(v_0, v_1, t) { return (1-t)*v_0 + t*v_1 } Step 1 linear interpolation between (x_f, y_f) and (x_c, y_f) Step 2 linear interpolation between x_f and x_c at y_c Step 3 interpolate the results of the two linear interpolations in x in the y direction I_y_f = lerp( I[x_f, y_f], I[x_c, y_f], x-x_f ) I_y_c = lerp( I[x_f,y_c], I[x_c, y_c], x-x_f ) I_xy = lerp( I_y_f, I_y_c, y-y_f ) x_f = floor(x) x_c = x_f + 1 y_f = floor(y) y_c = y_f + 1