in reply to Passing GD::Image object to Inline C

On perl side, use the in-memory open for the image file. C code needs a different import method; should be a trivial modification. Like this perhaps (completely untested):

open(PNG, '>', \my $img_data); ...; print PNG ... process_image($img_data); __C__ SV* process_image(SV *image_data) { { STRLEN dlen; SV *data = SvPV(image_data, dlen); gdImagePtr im = gdImageCreateFromPngPtr(dlen, data); ... }