-2

So I am basically trying to blend two pictures together by taking the weighted average of each pixel. However, in order for the transformation to apply, the two pictures must be exactly the same size. If not, then the first picture remains unchanged.

http://www.seas.upenn.edu/~cis120/current/hw/hw07/javadoc/Manipulate.html#alphaBlend(double,%20NewPic,%20NewPic)

This is basically what I have to do, but I need clarification. I'm not understanding what I have to do with the colors

user1993381
  • 179
  • 1
  • 2
  • 14

1 Answers1

3

Firstly, as this is blatantly homework, you should probably check that you're allowed to get code from the internet. If not you should be careful about what you take from answers you get, less you be accused of plagiarism and/or cheating.

Assuming this is fine however, you will want to interpret each NewPic as a bitmap. Then compare each Pixel in each bitmap with the corresponding Pixel in the second bitmap. Look at the average of each colour and use those to create a pixel in a third bitmap. Once you've created each pixel in the third bitmap, return it.

Philip Whitehouse
  • 4,293
  • 3
  • 23
  • 36