try this:
// Project: PrImage
// Created: 2019-04-07
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "PrImage" )
SetWindowSize( 640, 480, 0 )
SetWindowAllowResize( 0 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 640, 480 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
for x = 1 to 10
this = CreateObjectBox(100,100,100)
SetObjectPosition(this,Random(0,500)-250, Random(0,500)-250, Random(0,500)-250)
SetObjectColor(this,Random(128,255), Random(128,255), Random(128,255), 255)
next x
MoveCameraLocalZ(1,-750)
IMG = 0
thumb = CreateSprite(0)
SetSpriteSize(thumb,160,120)
SetSpriteTransparency(thumb,0)
for x = 1 to 6
this = CreateSprite(0)
SetSpriteSize(this,64,64)
SetSpriteColor(this, Random(128,255), Random(128,255), Random(128,255), 255)
SetSpritePosition(this,Random(0,600),Random(0,420))
SetSpriteAngle(this,Random(0,359))
next x
do
if GetRawKeyPressed(32) = 1
IMG = IMG + 1
Render()
GetImage(IMG,0,0,640,480)
ThisFile$ = "this"+STR(IMG)+".png"
SaveImage(IMG,ThisFile$)
repeat
`...
until GetFileExists(ThisFile$) = 1
this = LoadImage(ThisFile$)
SetSpriteImage(thumb,this)
SetClearColor(random(0,255),random(0,255),random(0,255))
endif
Sync()
loop
it's my first time playing with GetImage() but it works. saving as PNG, tho... i'm not sure what i need to do to retain the background color in the file (.jpg is fine).
otherwise, i'd consider
SetRenderToImage(), instead (which, IIRC, retains the BG color).
meanwhile, show us a code example where i'm not experiencing any "black and white" issues: