Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Ok, now it works for me! Thanks again! import random, os, time from PIL import Image INPATH = ('/home/.../Start/') OUTPATH = ('/home/.../Ziel/') dx = dy = 228 tilesPerImage = 25 files = os.listdir(INPATH) numOfImages = len(files) print(files) t = time.time() for file in files: im =

Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Ok, did it :) import random, os, time from PIL import Image INPATH = ('/home/sdrewes/Desktop/Portaits/Bilder/Test/') OUTPATH = ('/home/sdrewes/Desktop/Portaits/Bilder/Gut_Crop/') dx = dy = 228 tilesPerImage = 100 files = os.listdir(INPATH) numOfImages = len(files) print(files) t = time.time()

Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Hi Robin, I tried to understand and run your code, and I get the Error: "File "Rand_Crop.py", line 15, in with Image.open(os.path.join(INPATH, file)) as im: File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 528, in __getattr__ raise AttributeError(name) AttributeError:

Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Hi Peter, Hi Robin, thanks for your help, and especially for the code ;) @Peter: thanks for the links, I know, it is always better to write the code than to copy and paste! @Robin: the question, iḿ trying to answer is, if good pictures, in this case portraits, also have good "Parts", so if

Re: cropping a random part of an image

2016-08-09 Thread Robin Koch
Am 09.08.2016 um 14:40 schrieb drewes@gmail.com: I'm new to python and I have 30.000 pictures. I need to crop, let's say 100, parts of 256x256, randomly out of every picture. Interessting task. May I ask for the purose of this? I cant find an answer in the net, would be nice if someone

Re: cropping a random part of an image

2016-08-09 Thread Peter Otten
drewes@gmail.com wrote: > I'm new to python and I have 30.000 pictures. > I need to crop, let's say 100, parts of 256x256, randomly out of every > picture. > > I cant find an answer in the net, would be nice if someone could help me > out! You can walk over the files with

cropping a random part of an image

2016-08-09 Thread drewes . mil
Hi, I'm new to python and I have 30.000 pictures. I need to crop, let's say 100, parts of 256x256, randomly out of every picture. I cant find an answer in the net, would be nice if someone could help me out! Thanks! Steffen -- https://mail.python.org/mailman/listinfo/python-list