Combining 6 images without discoloration

1 vue (au cours des 30 derniers jours)
Gino
Gino le 20 Déc 2014
Modifié(e) : Gino le 22 Déc 2014
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 .
  1 commentaire
Image Analyst
Image Analyst le 20 Déc 2014
Attaching the images and reading this would be a good start.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 21 Déc 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 commentaire
Gino
Gino le 22 Déc 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);

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by