0

i have blended 2 images using alpha blending, with alpha = 0.03 because i want the second image cannot be seen. that is:

blended image = 0.97*image1+0.03*image2

i want to get the original of image 2 back but i can't. well, i can but the image is not perfect. it doesn't look exactly like the original, it's blurred. i use this formula to get it back:

image2 = (blended image - 0.97*image1)/0.03

does anyone have any idea what's wrong with it?

Z98n
  • 71
  • 1
  • 2
  • 4
  • It seems like rounding errors are creeping in. It is hard to say without exact knowledge of data types behind image1, image2 etc. Generally it is not good idea to such things. – Alexander B Mar 25 '15 at 10:19
  • Make sure you're converting your images to double precision before performing the blending. If your original images are uint8 then use `img_blend = 0.97*double(image1)+0.03*double(image2)` then `image2 = uint8((img_blend - 0.97*double(image1))/0.03)` – jodag Mar 25 '15 at 17:19

0 Answers0