how can i convert an image to bit stream
Show older comments
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 Comments
Matt Kindig
on 30 Apr 2013
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().
Walter Roberson
on 30 Apr 2013
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.
sammar
on 1 May 2013
Accepted Answer
More Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!