python help

Dimse Dut

Fledgling Freddie
Joined
Jun 27, 2004
Messages
402
Well im sitting here stuck on this piece of code any suggestions are welcome =D

def makeSinCityPicture():
sinCity = makePicture ("C:\\Documents and Settings\\Dimse\\My Documents\\My Pictures\\sin-city-orig.jpg")# Det jeg har gjort her er at giv min sti et bedre arbejds navn og defineret det til at være et billed
backGround = makePicture ("C:\\Documents and Settings\\Dimse\\My Documents\\My Pictures\\sin-city-back.JPG")# Det jeg har gjort her er at giv min sti et bedre arbejds navn og defineret det til at være et billed
show (sinCity)
show (backGround)
return (sinCity,backGround)

def smoothGreenSinCity ():
sinCity = makePicture("C:\\Documents and Settings\\Dimse\\My Documents\\My Pictures\\sin-city-orig.jpg")
pixels = getPixels (sinCity)
for p in getPixels(sinCity):
red = getRed(p)
green = getGreen(p)
blue = getBlue(p)
if(red+blue<1.565*green):
setGreen(p,255)

show (sinCity)

def redefineWoman ():
startx,starty,endx,endy =(41,1,461, 449)
for x in range(startx,endx):
for y in range(starty,endy):
currentPixel = getPixels(sinCity,x,y)
r = getRed(currentPixel)
g = getGreen (currentPixel)
b = getBlue (currentPixel)
value = (r+g+b)/3
if (g <255):
setColor(currentPixel, makeColor (r,g,b))


def makeMonster(SinCity,startX,startY,endX,endY):
for x in range(startX,endX):
for y in range(startY,endY):
currentPixel=getPixel(SinCity,x,y)
if getGreen(currentPixel) < 255:
g = getGreen(currentPixel)*0.9
r = getRed(currentPixel)*0.9
b = getBlue(currentPixel)*0.2
setColor(currentPixel,makeColor(r,g,b))

def SinCityBackGroundImage(sinCity,background):
for x in range(1,getWidth(sinCity)):
p = getPixel(SinCity,x,y).
if (getRed(p) + getBlue(p) < getGreen(p)
setColor(p,getColor(getPixel(background,x,y)))

def makeSinCityPicture():
sinCity = makePicture("C:\\Documents and Settings\\Dimse\\My Documents\\My Pictures\\sin-city-orig.jpg")
background = makePicture("C:\\Documents and Settings\\Dimse\\My Documents\\My Pictures\\sin-city-back.JPG")
smoothGreenSinCity(sinCity)
redefineWoman(SinCity,41,1,461,449)
makeMonster(SinCity,500,1,799,449)
SinCityBackGroundImage(sinCity,background)
show(sinCity)
print(sinCity)
repaint(sinCity)
writePictureTo(sinCity,r"C:\\Documents and Settings\\Dimse\\My Documents\\My Pictures\\sin_city_finished.jpg")
return sinCity
 

Sorin

Banned
Joined
May 23, 2005
Messages
950
well its something about sincity thats for sure.
it also seems to be danish.
something about an picture.

it could be a pk3 file.
it could be a exe file.
it could be a mod.
it could be a alot of files you just opened with wordpad.

what do you wanna know?
 

Dimse Dut

Fledgling Freddie
Joined
Jun 27, 2004
Messages
402
sorry for that odd post I had to hand that program and it didnt work. Tired+programms that dont work make me a cranky cookie.

it still doesnt work but I handed in =D I will probably be allowed to remake =D
 

arguyle

Fledgling Freddie
Joined
Feb 12, 2004
Messages
539
Dimse stop putting weed in those cookies before coming on Fh and talking gibberish :fluffle: :m00: :m00:
 

Ingafgrinn Macabre

Can't get enough of FH
Joined
Jan 4, 2004
Messages
3,155
Dimse Dut said:
sorry for that odd post I had to hand that program and it didnt work. Tired+programms that dont work make me a cranky cookie.

it still doesnt work but I handed in =D I will probably be allowed to remake =D
please use
Code:
 tags for code... that's what they're for, cos I'm missing all tabs that python needs.
 

Users who are viewing this thread

Top Bottom