Increase the brightness of an image

18 ビュー (過去 30 日間)
Rachel Barbera
Rachel Barbera 2017 年 11 月 16 日
回答済み: DGM 2022 年 4 月 19 日
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 Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by