Convert an 8 bit image to 12 bit
37 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to convert an image from 8bit to 12 bit. I understand 8 bit can go from 0-256 while 12 can go from 0-4095 i believe. Basically i am using the bit value for analysis purpose so using a 12 bit image makes more sense for me. However I don't have a lot of experience with image processing. Can i simply multiply the 8 bit values by a fraction of 256 or something similar? If anyone has any experience doing this can provide some feedback. I have read about going from 12 bit to 8 bit but it is hard to find information on going the other way.
0 commentaires
Réponse acceptée
Chunru
le 22 Août 2022
I = imread("peppers.png"); % 8-bit image
whos
I1 = double(I)/256; % 8->12bit
imwrite(I1, 'test.jpg', 'BitDepth', 12); % JPEG supports 12 bits
I2 = imread('test.jpg');
class(I2)
I2 = rescale(I2); % rescale
class(I2)
imshow(I2)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!