Increase the brightness of an image
17 次查看(过去 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!