Insert PNG image into normal image

5 Ansichten (letzte 30 Tage)
king umar
king umar am 18 Sep. 2019
Bearbeitet: Rik am 18 Sep. 2019
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 Kommentare
Guillaume
Guillaume am 18 Sep. 2019
@king umar, is your question about compositing two images with one having associated transparency info (i.e alpha blending)?
Rik
Rik am 18 Sep. 2019
Bearbeitet: Rik am 18 Sep. 2019
@Guillaume I wrote that comment on Chrome in Android (just like this one). It does seem strange.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Rik
Rik am 18 Sep. 2019
If you want to prevent overwriting the underlying image for some pixels, you can use a logical mask to only overwrite some pixels.
  1 Kommentar
king umar
king umar am 18 Sep. 2019
I have updated the question to be precise. Kindly, give your valueable feedback.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by