Remove black background in a translated png plot

조회 수: 1 (최근 30일)
Gabriele Dominioni
Gabriele Dominioni 2024년 5월 22일
댓글: Gabriele Dominioni 2024년 5월 26일
As in this picture, when i translate a png in a plot i get a black backgroung where the plot is not filled with the png. how can i set the color to white instead of black?
  댓글 수: 1
Les Beckham
Les Beckham 2024년 5월 22일
How did you translate the image? Show the code you used, or describe the GUI plot interaction that resulted in the undesired result. That should help in narrowing down to a possible solution.

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

채택된 답변

Kevin Holly
Kevin Holly 2024년 5월 22일
I = imread("cameraman.tif");
imshow(I)
title("Original Image")
J = imtranslate(I,[15, 25],'FillValues',255); %Add Fill Values here
imshow(J)
title("Translated Image")
J = imtranslate(I,[15, 25]); % Without it Fill Values
imshow(J)
title("Translated Image")

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by