This is variation of the above code; except this version will read from a collection of pictures rather than just a random palette.
You'll have to supply it a folder with a series of images named "frame01.png" , "frame02.png" etc etc
it assumes all the pictures
[pbcode]
path$="-LOCATION-OF-FILES-FOLDER-"
#include "freeimage"
openscreen 1920,1080,32,1
Screen=NewImage(GetScreenWidth(),GetSCreenHeight(),true)
Dim Images(100)
Bands=0
for lp=01 to 100
file$="Frame"+digits$(lp,2)+".png"
if fileexist(path$+file$)
image=LoadNewIMage(Path$+File$,2)
Images(Bands) = Image
drawimage image,0,0,false
sync
Bands++
endif
next
;Bands=2
BandWidth=GetScreenWidth()/Bands
dim Palette(Bands)
dim IMagePOinter(Bands)
dim IMageModulo(Bands)
for lp =0 to Bands
Palette(lp) =rndrgb()
Image=Images(lp)
rendertoimage Image
lockbuffer
ThisRGB=point(0,0)
IMagePOinter(lp) =getimageptr(image)
IMageModulo(lp) =getimagepitch(image)
unlockbuffer
next
rendertoscreen
ScreenWidth =GetScreenWidth()
ScreenHeight=GetScreenHeight()
rendertoimage Screen
lockbuffer
ThisRgb=point(0,0)
for ylp=0 to ScreenHeight-1
OffsetY=mod(Ylp,BandWidth)
DiagX = BandWidth-OffsetY
ColourY=mod(Ylp/BandWidth,Bands); Xor Colour
for xlp=0 to ScreenWidth-1
// compute the grid along x axis
GridX=Xlp / BandWidth
ColourX =mod(GridX,Bands)
// Add the X and y grid positions to find
// which band we're in with the palette
Colour = mod(ColourX+ColourY,Bands)
// compute the Xpos to side what side of the
// triangle we're in; if we're higher then
// we're in the next band of colour
Offset =mod(xlp,BandWidth) > DiagX
Colour =mod(Colour + Offset , bands)
//
Ptr =IMagePOinter(Colour)+(xlp*4)
Ptr+=IMageModulo(Colour)*Ylp
ThisRGB =peekint(Ptr)
dotc xlp,ylp,ThisRGB
next
next
unlockbuffer
rendertoscreen
drawimage Screen,0,0,false
Sync
FreeImage_SavePNG Path$+"Output.png",Screen
waitkey
waitnokey
[/pbcode]
Walking Out the bush - Time Lapse