I would like to crop an image using PIL, although it could be some other module. I need the method to crop with a scale factor, ie 1.5 meaning that the output would be 1.5x zoomed in. Additionally, I would need to set the center where it zooms. This means setting x/2,y/2 as the center would zoom straight to the center, but other x,y values would zoom into those pixels.
If anyone knows how to do this I would really appreciate any help.
Right now I have some cropping working with ims = im.crop((int((x-x/i)/2), int((y-y/i)/2), int((x+(x/i))/2), int((y+(y/i))/2))) but that only zooms into the center, and "i" doesn't give a nice scale factor.
Again, that you for your help.
It is just a matter of getting the center and the sizes right.
The following script should do the trick.
Original image:
crop_amsterdam_01.jpg:
crop_amsterdam_02.jpg:
crop_amsterdam_03.jpg: