Resize image matrix + needed type.