Increase the brightness of an image

11 次查看(过去 30 天)
Hi all, I am trying to increase the brightness of an image by adding 100 to each pixel value. Can I know what's the code and step for it?

采纳的回答

KSSV
KSSV 2017-11-16
I = imread('peppers.png') ;
I1 = I+100 ;
imshow(I1) ;

更多回答(1 个)

DGM
DGM 2022-4-19
While simple addition is probably the best answer, there are also various tools that may be used to accomplish simple adjustment of brightness and related image properties. Tools like imadjust() can accomplish the same goal, and might offer some convenience in that they're class-agnostic and have the capacity to simultaneously do other tasks.
% a linear series (placeholder for an image)
A = uint8(linspace(0,255,100));
% demonstrate that imadjust can be used for purely additive adjustment
db = 100; % amount to increase brightness
B = imadjust(A,[0 255-db]/255,[db 255]/255);
plot(A,B)
axis equal
xlim([0 255])
ylim([0 255])
% but it can also be used for combined brightness/contrast adjustment
C = imadjust(A,[0 145]/255,[50 255]/255);
plot(A,C)
axis equal
xlim([0 255])
ylim([0 255])
Whether the added complexity of using purpose-built adjustment tools is warranted is a decision I'll leave to the reader.
The following (nearly identical) question includes an answer that attempts to review the options available in IPT and MIMT:

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by