If the images are in a custom format, then it depends on the details of the custom format.
Some of the standard image formats include run-length encoding; if you have one of those, then you would use imread()
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!