transformation d'une image de 8bits par une image de 4bit,

3 views (last 30 days)
Bonjour,
j'ai besoin d'une code au Matlab qui divise le nombre de bits d'un pixel de 8 bits à 4 bits pour chaque pixels
par exemple.
nbre de bits de pixel (8bits) = 10110011., ce pixel la va transforme par deux pixels et pour chaque pixel contient de 4 bits.
premiers pixels (1011) et seconds pixels (0011).
Merci

Answers (1)

Ameer Hamza
Ameer Hamza on 3 Apr 2020
Edited: Ameer Hamza on 3 Apr 2020
MATLAB does not natively support a 4bit data type. However, you can discard the bottom 4 bits of uint8 to get the desired results.
im8 = imread('cameraman.tif');
im4 = im8/2^4*2^4;
8 bit image:
4 bit image:
  4 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!