#!/usr/bin/perl use strict; use warnings; use Image::Magick; use MIME::Base64; # Create test Image my $img = Image::Magick->new(); $img->Set(size=>'20x20'); $img->ReadImage('xc:white'); $img->Annotate( text => '?', family => 'Arial', stroke => 'black', pointsize => 20, x => 4, y => 17 ); # serialize Image als base64 coded GIF my $data=encode_base64($img->ImageToBlob(magick => 'gif')); # test print print $data; # read Image from string my $img2=Image::Magick->new(); $img2->BlobToImage(decode_base64($data)); #test output $img2->Display();