# how do I make this image whietish?

조회 수: 1(최근 30일)
Wonwoo Cho 2021년 12월 13일
편집: DGM 2022년 11월 13일
How do I make this first image like this second image?
##### 댓글 수: 1표시숨기기 없음
Walter Roberson 2021년 12월 13일

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

### 채택된 답변

Yusuf Suer Erdem 2021년 12월 13일
##### 댓글 수: 1표시숨기기 없음
Wonwoo Cho 2021년 12월 13일
Thank You sir, you saved me :D

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

### 추가 답변(1개)

DGM 2022년 11월 13일
편집: DGM 2022년 11월 13일
To recreate this image in this specific example, we might compare it directly to its source and see what's been changed. Unfortunately, the result is a screenshot, so it's not the right size and it has then been subsequently cropped so that some edges are missing and others have padding. Stop saving images by saving the figure. It's only slightly less ridiculous than taking a tilted portrait photograph of the monitor with a cell phone.
So let's say we went out of our way to try to resize/crop/fill the image back into rough correspondence with the original. Then we could compare the two. I'm going to assume that whatever transformation was applied was applied equally to all channels.
A = imread('peppers.png'); % the original
B = imread('cccc.png'); % the garbage image
% try to figure out what each input value maps to
av0 = im2double(A(:));
bv0 = im2double(B(:));
[av idx] = unique(av0);
bv = zeros(size(av));
for k = 1:numel(av)
idx = av0 == av(k);
thesepix = bv0(idx);
bv(k) = median(thesepix);
end
plot(av,bv)
xlim([0 1])
ylim([0 1])
Why am I binning and finding the median for all the pixels instead of just comparing each one? That's because two pixels with the same value in A won't necessarily map to the same value in B -- because B is a significantly degraded copy of what used to be the actual output. B has been subject to interpolation when displayed, and again when saved. Whenever the saved image was then opened and edited manually, any number of other things might have happened. Yet more interpolation happens when B was rescaled to register it with A. Everything is blurred and slightly misaligned. If we had just tried to compare the pixel values directly, this is all we'd see:
If we can get a clear plot, we try to see if there's an obvious indication of what the initial value transformation was. Given the roughly piecewise-linear plot, it looks like a basic levels adjustment. Maybe there's a bit of gamma; maybe that's just reading tea leaves.
C = imadjust(A,[0 0.2],[0.2 1],1.2); % recreate the requested image
montage({B,C})

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

### 범주

Find more on Convert Image Type in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by