简体   繁体   中英

Save image with ocaml graphics

i want to save the picture generated by ocaml graphics in a file (png or jpeg). Thank you.

I'm going to assume that you are talking about the Graphics module in ocaml.

You should notice that the Graphics module isn't for creating and processing images. You can of course call Graphics.dump_image if you've already gone ahead and wrote something that produces the Graphics.image type. This will produce a color array array , where color is a packed integer in the format, 0xRRGGBB.

After some other conversion functions you should call upon camlimages to produce your image, and there is a code sample from another question .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM