Images to Matrix convertation methods