I didn't need to use a memblock in the end, because this code only takes 1 minute. It still syncs too without the sync. So there must be extra syncs in there hidden away.
set display mode 1280,1024,32
set text opaque
sync off
Load image "MyPicture.jpg",1
Load Image "Cursor.jpg",2
Load image "Red.jpg",3
Load image "Blue.jpg",4
Load image "Green.jpg",5
Load image "Green2.jpg",6
`sprite 1,x,y,2
create bitmap 1,1280,1024,32
Paste image 1,0,0
set current bitmap 0
donothing = 0
do
if donothing < 1
RED = 0
BLUE = 0
GREEN = 0
Paste image 1,0,0
lock pixels
R = RGBR(POINT(x,y))
G = RGBG(POINT(x,y))
B = RGBB(POINT(x,y))
if R = 255 and G = 255 and B = 255
x = x + 10
if x > 1280 then x = 0 : y = y + 10
Else
for Y1 = 1 to 10
For X1 = 1 to 10
R = RGBR(POINT(x1+x,y1+y))
B = RGBB(POINT(x1+x,y1+y))
If R = 0 and B = 0 and x < 20 then Donothing = 1
If R > B and R > G
inc Red
endif
If B > R and B > G
inc Blue
endif
If G > R and G > B
Inc Green
Endif
Next X1
Next Y1
unlock pixels
set current bitmap 1
If red > blue and Red > Green
paste image 3,x,y
Endif
If blue > Red and Blue > Green
paste image 4,x,y
Endif
If Green > Red and Green > Blue
If G > 234
paste image 5,x,y
else
paste image 6,x,y
Endif
Endif
endif
set current bitmap 0
x = x + 10
if x > 1280 then x = 0 : y = y + 10
if y > 900 then donothing = 1
Text 10,10,"AMOUNT OF RED " + str$(RGBR(POINT(x,y)))
Text 10,20,"AMOUNT OF GREEN " + str$(RGBG(POINT(x,y)))
Text 10,30,"AMOUNT OF BLUE " + str$(RGBB(POINT(x,y)))
Paste image 2,x,y
endif
if donothing = 1
set current bitmap 1
save current bitmap "CMB Recolour.bmp":end
WAIT KEY
endif
Loop