Chroma key

Blitz3D Forums/Blitz3D Programming/Chroma key

Thanks for that JFK this is the routine that I currently use

;-----------------------------------------------
Function chroma_blue_single(chroma_image$)
;-----------------------------------------------

Cls
SetBuffer BackBuffer()
image=LoadImage(chroma_image$)
DrawImage image,0,0
LockBuffer BackBuffer()

For y=0 To ImageHeight(image)
For x=0 To ImageWidth(image)

int_rgb=ReadPixelFast (x,y)
rgb_blue=getblue(int_rgb)
rgb_red=GetRed(int_rgb)
rgb_green=GetGreen(int_rgb)

If rgb_blue-rgb_green>intensity And rgb_blue- rgb_red>intensity

WritePixelFast(x,y,mask_value)

EndIf
Next
Next

UnlockBuffer BackBuffer()
End Function


Which is pretty much as you suggest. But I just thought that it was a bit simple and thought that there must be a much better,more effective way of doing this.

Maybe this is an effective way, my results haven't been too bad.