Increase the brightness of an image
18 ビュー (過去 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?
0 件のコメント
採用された回答
その他の回答 (1 件)
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:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!