You just need to do something like this (pseudocode):
For n = 1 to 10 ; 10 frames
SetBuffer ImageBuffer(image,n)
LockBuffer
For x = 1 to imagewidth
For y = 1 to imageheight
c = ReadPixelFast x,y
If c = shirtcolor Then WritePixelFast x,y,newcolor
Next
Next
UnlockBuffer
Next
SetBuffer BackBuffer()
If you want to make a copy first, just do a CopyImage ahead of time and run this routine on the copy instead.
Edit: Yeah, you do this before your main loop.
For n = 1 to 10 ; 10 frames
SetBuffer ImageBuffer(image,n)
LockBuffer
For x = 1 to imagewidth
For y = 1 to imageheight
c = ReadPixelFast x,y
If c = shirtcolor Then WritePixelFast x,y,newcolor
Next
Next
UnlockBuffer
Next
SetBuffer BackBuffer()
If you want to make a copy first, just do a CopyImage ahead of time and run this routine on the copy instead.
Edit: Yeah, you do this before your main loop.