Adding a transparent object image to the cover image..

11 views (last 30 days)
I'm having a transparent bird image of size 64*64,(png). When i try to add it a certain block of the same size of a background sky image of total size 512*512 (jpg), the pixels of both the images are getting added...but,i want only the pixels of the bird to be visible in the sky background..can't solve it for a long time.can anyone help me please....

Answers (1)

Walter Roberson
Walter Roberson on 28 Jan 2013
Which of the images are moving?
What is your layering? bird on top of sky on top of something else?
You want the bird to be visible no matter where it is on the sky, or you only want it to be visible on certain features in the sky such as against a cloud?
Are you asking about transparency, or are you asking about clipping when the bird gets close to the edge of the sky that is the only thing that should be visible? If you want the sky to occupy the whole window and the bird to be clipped as it gets to the edge, then the way to do that is to set the axis limit mode to be manual and set the axis limits to just cover the sky.
  2 Comments
Nirmaladevi Alagarsamy
Nirmaladevi Alagarsamy on 29 Jan 2013
we have a background rgb cover image on which rgb object image with transparent property have to be pasted... but, the pixels of both cover and object image are getting added.
what can be done to embed object(bird) image on cover(sky) image without addition of pixels ?
Walter Roberson
Walter Roberson on 29 Jan 2013
Make the rgb object not transparent then. By definition, transparent objects show some of what is underneath them. The formula is
alpha * overlay_pixel + (1-alpha) * underlay_pixel
so the underlay will influence the final value unless alpha = 1, which is the non-transparent case.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!