The 2nd one:
SS
SS
Here's a practical example using your image above:
Point 1 is at coordinates 1,1 (and Point 2 is at 2,2) counting from the top-left.
Divide by Size-1 of the destination image (4-1=3) and multiply by Size-1 of the source image (2-1=1) giving 0.333,0.333
(I'll ignore Point 2 from now on)
Then floor your coordinates to get the base pixel, and take just the fractional part to get the blend amounts. So BaseX=0,BaseY=0, BlendX=0.333, BlendY=0.333
Then use the following formula to get the colour:
Code:
Colour("Source",BaseX, BaseY) *(1-BlendX)*(1-BlendY) +
Colour("Source",BaseX+1,BaseY) *(BlendX) *(1-BlendY) +
Colour("Source",BaseX, BaseY+1)*(1-BlendX)*(BlendY) +
Colour("Source",BaseX+1,BaseY+1)*(BlendX) *(BlendY)
Note that the corner pixels of the destination image always match the corner pixels of the source image, and the edges of the image are all 1-d blends (BlendX or BlendY 0)
EDIT: If you don't get it from this, then I'll make a working example after work.