MATLAB: How to convert bytes into image again

digital image processing

I have an image of 294x558x3 size
I read it byte by byte by using
ImageAsBytes = typecast(CoverImage(:), 'uint8')
to perform some specific operation but now after peforming
how can I covert it back to image format??

Best Answer

reshape( typecast(ImageAsBytes, class(CoverImage)), size(CoverImage))