Hier ist der Code:
Code: Alles auswählen
while (xs,ys) != (xe,ye):
if xs > xe:
if ys > ye:
w = 100
h = 100
while w != 0:
while h != 0:
if Bild.getpixel((xs-w, ys-w)) == weiss:
wc = wc + 1
else:
sc = sc + 1
h = h - 1
h = 100
w = w - 1
if wc == 0:
inf = 100
while inf != 0:
xs = xs - 1
ys = ys - 1
Bild.putpixel ( (xs,ys), grun)
inf = inf -1
Bild.save('Abcdefg.png')
Ich habe hier einige Beispielnamen:
zweimal funktioniert:
A.png
name.png
einmal:
quax.png
name.jpg
A.jpg
garnicht:
quax1.png
Abcdefg.png
_.png
Wieso ist das so?