When you execute the function to obtain the array of pixels you can select the format of the image in the array (I need jpeg compression.).
I have extended the gtk2pixbas.pas unit with this code:
type AByteIn= array of byte;
type PAByteIn= ^AByteIn;
type TGdkPixbufSaveFunc= function(buffer:PChar; count:gsize; error:PPGError; AAByteIn:PAByteIn): gboolean; cdecl;
function gdk_pixbuf_save_to_callback(pixbuf:PGdkPixbuf; save_func:TGdkPixbufSaveFunc; data:gpointer; _type:Pchar; error:PPGError): gboolean; cdecl; external gdkpixbuflib;
The code works well but obtain an jpeg image requires some seconds.
With RGBGraphics libraries obtain a jpeg image requires 150 milliseconds.
Do you now a faster way?