The interp command interpolates two images linearly in the XYZ color space.
w h=(1−t)w1 h1+t w2 h2, ln |
| =(1−t)ln |
| +tln |
| . |
To interpolate pixel data, interp first resizes both images to w× h. The RGB values of individual pixels are then computed by a perceptually uniform linear interpolation between the corresponding values in img1 and img2 (see Section 19.1.3).
To begin, load two images:
img1:=image("/home/luka/Pictures/xcas-logo.png") |
|
img2:=image("/usr/local/share/giac/examples/Exemples/demo/terre.jpg") |
|
display(img1); display(img2,400) |
Now blend the two images together with t=0.6:
img:=interp(img1,img2,0.6) |
|
display(img) |