rlepigre / ocaml-imagelib

The imagelib library implements image formats such as PNG or PPM
GNU Lesser General Public License v3.0
39 stars 13 forks source link

Allow read/write from Bigarray blob #30

Open bluddy opened 4 years ago

bluddy commented 4 years ago

Since we lack good functionality for combining/stacking Bigarrays (as in numpy), it would be very useful to provide functions that convert to/from the image format in this library to Bigarrays, such as the ones used in C code or by the TSDL library. Those formats are obviously dynamic rather than statically checked, but they're required by other libraries.

I'd be happy to submit such code if you agree on its usefulness.

rlepigre commented 4 years ago

As the internal representation of images is exposed, isn't that already possible? If not, can you explain what is it you need exactly?

cfcs commented 4 years ago

You mean like in layer support using multi-dimensional bigarrays @bluddy?

bluddy commented 4 years ago

I mean that it's easier to have an interface that just works with multi-dimensional bigarrays, rather than having to match the exact data type used by imagelib.