Code: Alles auswählen
Procedure ConvertToOneBit(image)
StartDrawing(ImageOutput(image))
For x = 0 To ImageWidth(image)-1
For y = 0 To ImageHeight(image)-1
rgb=Point(x,y)
If Red(rgb)+Green(rgb)+Blue(rgb)>383
f = 255
Else
f = 0
EndIf
Plot(x, y,RGB(f,f,f))
Next
Next
StopDrawing()
EndProcedure
Procedure ConvertToMosaic(image,xa,ya,width,height,stp)
Protected xdes=xa+width,ydes=ya+height
StartDrawing(ImageOutput(image))
For x = xa To xdes Step stp
For y = ya To ydes Step stp
rgb=Point(x,y)
Box(x, y,stp,stp,RGB(Red(rgb),Green(rgb),Blue(rgb)))
Next
Next
StopDrawing()
EndProcedure
Procedure ConvertToNegativ(image)
StartDrawing(ImageOutput(image))
For x = 0 To ImageWidth(image)-1
For y = 0 To ImageHeight(image)-1
rgb=Point(x,y)
Red=255-Red(rgb)
Green=255-Green(rgb)
Blue=255-Blue(rgb)
Plot(x, y,RGB(Red,Green,Blue))
Next
Next
StopDrawing()
EndProcedure
Procedure ConvertToBW(image)
StartDrawing(ImageOutput(image))
For x = 0 To ImageWidth(image)-1
For y = 0 To ImageHeight(image)-1
rgb=Point(x,y)
Col=(Red(rgb)+Green(rgb)+Blue(rgb))/3
Plot(x, y,RGB(Col,Col,Col))
Next
Next
StopDrawing()
EndProcedure
Procedure ConvertToRGB(image,type)
StartDrawing(ImageOutput(image))
For x=0 To ImageWidth(image)-1
For y = 0 To ImageHeight(image)-1
rgb=Point(x,y)
Select type
Case 1 ;Red
Col=Red(rgb)
Plot(x, y,RGB(Col,0,0))
Case 2 ;Green
Col=Green(rgb)
Plot(x, y,RGB(0,Col,0))
Case 3 ;Blue
Col=Blue(rgb)
Plot(x, y,RGB(0,0,Col))
EndSelect
Next
Next
StopDrawing()
EndProcedure
Procedure ReplaceColor(image,color,targetcolor)
StartDrawing(ImageOutput(image))
For x=0 To ImageWidth(image)-1
For y = 0 To ImageHeight(image)-1
rgb=Point(x,y)
If rgb=color
Plot(x,y,targetcolor)
EndIf
Next
Next
StopDrawing()
EndProcedure