scijs / get-pixels

Reads an image into an ndarray
MIT License
543 stars 108 forks source link

Output dtype #39

Open dy opened 6 years ago

dy commented 6 years ago

Would be nice to provide various output data formats, not necessarily ndarray:

For example: getPixels(src, { dtype: 'uint8' }, cb)

roborourke commented 6 years ago

Just ran into this use case when trying to use apply-cube-lut with this package. When converting RGBA channels to 0-1 values they were being rounded down.

Would be good to support the same values as the 2nd argument for ndarray-from-image.