Code archives/Graphics/Negative

This code has not been declared by its author to be Public Domain code, and therefore should not be assumed to be so.

Download source code

Negative by MuffinRemnant
(Posted 25 years ago)
Slow but functional.
Graphics 800,600,16,1
SetBuffer BackBuffer()
Global av#

; hardcoded for the named bitmap 64x64 pixels...
img=LoadImage("test.bmp")


For y=0 To 63
	For x=0 To 63


		SetBuffer(ImageBuffer(img))		
		GetColor(x,y)
		
		r=ColorRed()
		g=ColorGreen()
		b=ColorBlue()
		
		av=255-(r+g+b)/3
		
		Color av,av,av
		SetBuffer BackBuffer()

		Plot x,y
		
	Next
Next

Flip

WaitKey()

End 

Comments

None.

Code Archives Forum