MATLAB: JPEG file into an array

jpeg array

Hi,
is it possible to convert an JPEG file into an array in Matlab? What about the reverse conversion?
Owen

Best Answer

Owen - when you read the JPEG image with imread the output from this function is an array. For example,
A = imread('myImg.jpg');
A is a matrix (multi-dimensional array). You can then use imwrite to save the matrix/array as a JPEG.