How to convert 16 bit grayscale image to 8 bit using linear mapping with libvips

281 views Asked by At

I would like to convert a 16 bit grayscale image to 8 bit, where the lowest value of the 16 bit image becomes 0, and the highest becomes 255

As far I can see, I can call vips-hist-norm, which will map it across the full 16 bit range.

However its unclear to me how I can then convert to 8 bit.

1

There are 1 answers

0
Red Riding Hood On BEST ANSWER

vips-scale will perform linear mapping of current type to uchar type.