# Increasing exposure of an image

53 views (last 30 days)
Michelle on 15 Nov 2020
Edited: DGM on 22 Mar 2022
I have to increase the exposure of photo 2 so that it looks like it "whited out". How would I do this? The code I have below is on converting an image to grayscale.
The photos are also included in the zip file.
% Convert it to double
img1Double = im2double(img1);
% Convert from RGB to grayscale
img1Gray = rgb2gray(img1);
figure
imshowpair(img1, img1Gray, 'montage')
% Convert it to double
img2Double = im2double(img2);
% Convert from RGB to grayscale
img2Gray = rgb2gray(img2);
figure
imshowpair(img2, img2Gray, 'montage')

Subhadeep Koley on 15 Nov 2020
A simple approach could be adding a constant value to the entire image. Like below,
% Add a constant value to the image
% Visualize them
figure
imshowpair(img, overExposedImg, 'montage')
##### 2 CommentsShowHide 1 older comment
DGM on 22 Mar 2022
Edited: DGM on 22 Mar 2022
If it's assumed that the gamma correction is a simple power function, then the cheap solution would be to just apply the gamma to the multiplication factor instead of eating the cost of fractional exponentiation of the entire array.
k = 1.5; % intensity scaling
g = 2.4; % assumed gamma
A = im2double(A);
B = A*(k^(1/g));
B = im2uint8(B);
imshow(B) Otherwise I suppose you could do the whole thing.
k = 1.5;
A = im2double(A);
B = lin2rgb(rgb2lin(A)*k);
B = im2uint8(B);
imshow(B) DGM on 22 Mar 2022

### Categories

Find more on Blocked Images 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!