Insert PNG image into normal image

조회 수: 4 (최근 30일)
king umar
king umar 2019년 9월 18일
편집: Rik 2019년 9월 18일
Normally, there is no problem, if we load two images in jpg formats, and insert one image to another as logo. But due to background and boarders, we need to insert png image. the output is attached
** how to handle png images.
As we know that png images have no backgroud, but once they are loaded in matlab, background turns into black. how to handle the background.
consider following image,
img1 = imread('1.jpg');
logo = imread('logo.png');
img1(1:size(logo,1), 1:size(logo,2), :) = logo;
imshow(img1)
  댓글 수: 5
Guillaume
Guillaume 2019년 9월 18일
@king umar, is your question about compositing two images with one having associated transparency info (i.e alpha blending)?
Rik
Rik 2019년 9월 18일
편집: Rik 2019년 9월 18일
@Guillaume I wrote that comment on Chrome in Android (just like this one). It does seem strange.

댓글을 달려면 로그인하십시오.

답변 (1개)

Rik
Rik 2019년 9월 18일
If you want to prevent overwriting the underlying image for some pixels, you can use a logical mask to only overwrite some pixels.
  댓글 수: 1
king umar
king umar 2019년 9월 18일
I have updated the question to be precise. Kindly, give your valueable feedback.

댓글을 달려면 로그인하십시오.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by