From: caused
Your library does leak alot, causing simba to crash after a while ;/
@caused;
EDIT: I added debugging to demonstrate garbage cleanup works and that there are/were no leaks.. I also fixed the RGBA to BGRA so you may now test that.. I also monitored task manager.

To answer your questions:
Yes there is garbage cleanup but as mentioned, it will only automatically clean up for you when the script thread dies or when you call ReleaseGC..
Deliberately temporarily leaking it by doing:
begin
repeat
ImageFromCursor; //not even using the returned result..
Sleep(1);
until(false);
end.
Is a no-no.. Repeating that until "FALSE" or putting it in an infinite loop. Even with the above, it does NOT leak. As soon as the exception is thrown or the script terminates, the garbage cleanup kicks in. You can manually invoke it as well..
It's roughly this much allocations for your script above:
32x32 cursor on my system. 32 x 32 x SizeOf(RGBA) = 32 x 32 x 4. Add that to the size of a pointer and the internal storage for garbage collection.. lets assume that's a total of: 4176 bytes each loop..
Max heap size on most x64 systems with 6gb ram is ROUGHLY: 2gb or 2147483648 bytes (also the max size of a Java string on my school computer). I am able to allocate 4gb on my system..
2147483648 / 4176 = 514244 allocations.. This is assuming that Simba makes 0 allocations of its own.
Using the following snipper:
{$loadlib Riddler}
var
I, J: Integer;
begin
repeat
ImageFromCursor;
if (I > 10000) then
begin
J := I;
I := 0;
writeln(J);
end;
I := I + 1;
Sleep(1);
until(false);
end.
The results of letting it run until an exception was thrown or it ran out of memory was: 503k allocations/images..
That is a LOT! That's far more bitmaps than you would use on average running a script..
The wrong colours aren't actually "wrong". It's how Simba interprets it that is different. It returns pixels to you in RGRA format and Simba probably interprets them in BGBA format. I've had this problem with feeding colours to SMART as well. You can either swap the B and R values or I can swap them..
I fixed it and made it export as BGRA instead of RGBA.