How do I crop an image loaded from a file in Blender (using a Python script). The standard Python's Image.crop() function doesn't seem to be available in the Image class.
UPDATE:
I wrote some code by myself, which copies specified pixels of the original image but the output image is somehow screwed up.
This is the original image (some gfx from deviantart): http://postimg.org/image/xegpwy0ur
This is the image after processing - i took a 100x100 fragment (first 10000 pixels of the original image): http://postimg.org/image/c57j2vvjp
And this is the code: http://pastecode.org/index.php/view/5045500