Combining 6 images without discoloration

1 view (last 30 days)
I tried combining multiple smaller images with a Background.
In the resulting image the background is just fine, but the smaller images that are added in don't have the right color .
Startimage((Py-12):(Py+11), (Px-12):(Px+11)) = Ppic(1:24,1:24);
This line puts Pacman into the Picture according to his Posisition and animation state.
-----
The desired image looks kind of like this:
How does one go about solving this problem ?
Edit : All the files have now been attached. I am sorry.
Edit2 : Cut everything unrelated to my question out and reuploaded.
===
Thank you for your time and consideration .

Accepted Answer

Image Analyst
Image Analyst on 21 Dec 2014
Your "gameimage" variable is a 3D RGB color image but you're not assigning any colors. You're treating it like it's a grayscale 2D image, which it's not. You'll have to assign all three color channels.
  1 Comment
Gino
Gino on 22 Dec 2014
Thank you ! It works. I just needed to change
Startimage((Py-12):(Py+11), (Px-12):(Px+11)) = Ppic(1:24,1:24);
to
Startimage((Py-12):(Py+11), (Px-12):(Px+11),1:3) = Ppic(1:24,1:24,1:3);

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!