Cut image into multiple pieces ( PIL)

This is the place for queries that don't fit in any of the other categories.

Cut image into multiple pieces ( PIL)

Postby s_81 » Mon Oct 28, 2013 10:09 am

I have image splited with white lines .
How to cut image into multiple pieces by this lines ?

Code: Select all
from PIL import Image, ImageOps

mask = Image.open('/root/test/fig2.png').convert('L')
im = Image.open('/root/test/longcat.jpg')
output = ImageOps.fit(im, mask.size, centering=(0.5, 0.5))
output.putalpha(mask)
output.save('/root/test/output.png') 
Last edited by Mekire on Mon Oct 28, 2013 10:20 am, edited 1 time in total.
Reason: First post lock.
s_81
 
Posts: 1
Joined: Mon Oct 28, 2013 10:03 am

Re: Cut image into multiple pieces ( PIL)

Postby ochichinyezaboombwa » Mon Oct 28, 2013 9:42 pm

Try Image.crop(...)
ochichinyezaboombwa
 
Posts: 200
Joined: Tue Jun 04, 2013 7:53 pm


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 4 guests