How to read an image & convert it into an array and vice versa

6 views (last 30 days)
Hello ,
how to convert an image to 1x2 array & be able to do the inverse ?

Answers (1)

Jon
Jon on 18 Nov 2021
Edited: Jon on 18 Nov 2021
You can use MATLAB's imread and imwrite functions for this.
On the command line you can type doc imread to get documentation for imread, similarly doc imwrite for imwrite.
By the way I think you meant convert an image to an m x n array, an 1x2 array would only have one row and two columns.
  2 Comments
Muhammad Abdulrazek
Muhammad Abdulrazek on 18 Nov 2021
the image is "original"
when i apply some algorithm on it it is converted to [167,164]
How to retreive this image from an array like this ?
Jon
Jon on 18 Nov 2021
The only image appears to be in the variable that you call original. The variables that you call Original_Data and DecryptedText are just arrays with two elements (1 row by 2 column). There is no image in Original_Data it is just two numbers.
If you want to display the image in the variable you call original, you can use the functions image or imagesc

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Tags

Products


Release

R2016a

Community Treasure Hunt

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

Start Hunting!