extract any part of image

I have been requested to extract to memory portions of an image which are not rectangular in shape. Is this possible and how? The shape right now is a 4 sided polygon, but again is not rectangular in nature.