I recently began using Magick++ (C++ API for ImageMagick) with the goal of creating a website that could display randomly generated images. I am trying to write a CGI script which would create a JPEG Image, set the color of its pixels, and then return the image information as Content-type: image/jpg
.
Reading through the documentation, I only find functions for writing image files to disk. I do not see one which would do what I am hoping to do, along the lines of std::cout << Image
or std::cout << Blob
My goal is to be able to display the image generated by the script in a webpage, without needing to write the image to disk.
I know that PerlMagick has a display function which does what I am trying to do - I am wondering if I can do the same with Magick++.