reads pixel data from image