To create an image from a standard type, simply call the appropriate function. For example, if you have a fz_buffer with the source data:
If the data is in a file, use:
This loads the data into memory, and calls fz_new_image_from_buffer internally.
If the data cannot be recognised from its header, and more information is required, then the data can be formed in a fz_compressed_buffer, and an image created with:
Finally, if we have a decoded fz_pixmap, we can form a new image from it: