how can i convert an image to bit stream

hey all is ther any way to convert image to bit stream or to ASCII code ?? please i need ur help thanks in advance

3 Commenti

If the image is converted to uint8() format (simply by taking uint8(Image)), it is already in ASCII format-- you can then reshape() the resulting matrix into a single row/column to get a byte stream. Something like this:
Image8 = reshape(uint8(YourImageMatrix), 1, []);
Note that if you have an indexed image, this will saturate your image at 255 unless you have converted it to RGB before, using ind2rgb().
Technically not: ASCII is only from 0 to 127, not 0 to 128. Also note that not all ASCII characters are printable, and that some ASCII characters (such as NUL or IDLE) may be "eaten" by communications systems.
To transform a data array to printable ASCII, using "uuencode" or the like is recommended.
@matt kinding thank you very much i have got that

Accedi per commentare.

 Risposta accettata

dec2bin(typecast( YourImageMatrix(:), 'uint8' ), 8)
Now what?

2 Commenti

thaaaank you very much i got the correct result
Hi there is it possible, if I change the image into a stream and then add another stream to that one, OR NOT please need help as fast as you can thanks

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Convert Image Type in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by