How to transform 16-bit pixels into 8-bit pixels ?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, I want to ask. I already constructed a coding which can only process 8-bit image(grayscale). But my problem right now some image contains 16-bit pixel, which is above 255. I want to detect the pixels that are above 255 and I want to reduce it into 8-bit, I'm not gonna transform the full image into 8-bit because this will affect my image quality. How to construct the coding that can detect pixel that is above 255?
0 件のコメント
回答 (1 件)
Walter Roberson
2018 年 4 月 12 日
If you want to reduce the high pixels to 255, then you can just uint8() the array. That will have the same effect as
uint8( min(255, TheArray) )
Otherwise you can use
mask = TheArray > 255;
TheArray(mask) = ... whatever, maybe mod(TheArray(mask), 256)) maybe something else
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!