You can try manipulating the drawing buffer
Code:
Procedure Reduce4bpp(buffer, numPixels); reduce to 4bpp (4096 colors)
EnableASM
MOV ecx, numPixels
MOV edx, buffer
!push ebx
!reduce4bpp_loop:
!mov eax, [edx]
!and eax, 0xf0f0f0f0
!mov ebx, eax
!shr ebx, 4
!or eax, ebx
!mov [edx], eax
!add edx, 4
!dec ecx
!jnz reduce4bpp_loop
!pop ebx
DisableASM
EndProcedure
Procedure Reduce2bpp(buffer, numPixels); reduce to 2bpp (64 colors)
EnableASM
MOV ecx, numPixels
MOV edx, buffer
!push ebx
!mov ebx, edx
!reduce2bpp_loop:
!mov eax, [ebx]
!shr eax, 6
!and eax, 0x03030303
!imul eax, 0x55
!mov [ebx], eax
!add ebx, 4
!dec ecx
!jnz reduce2bpp_loop
!pop ebx
DisableASM
EndProcedure
OpenWindow(0,0,0,640,480,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
AddWindowTimer(0,0, 50)
UsePNGImageDecoder()
UsePNGImageEncoder()
Repeat
Event = WindowEvent()
If Event = #PB_Event_Timer
MX_Release(Image)
image = MXSnapshot_TakeSnapshot(640)
tempimage=CreateImage(#PB_Any,640,480)
StartDrawing(ImageOutput(tempimage))
DrawImage(image,0,0,320,240)
Reduce2bpp(DrawingBuffer(), 640 * 480)
StopDrawing()
StartDrawing(WindowOutput(0))
DrawAlphaImage(ImageID(tempimage),0,0)
StopDrawing()
FreeImage(tempimage)
EndIf
Until Event=#PB_Event_CloseWindow
MXSnapshot_StopSession()