Fast image RGB to BGR conversion

898 Views Asked by At

I need to perform conversion of images from BGR to RGB image format and also backward conversion. I found Simd Library which contains function SimdBgrToRgb which performs fast conversion from BGR to RGB. But I didn't find any function for backward (RGB to BGR) conversion.

Maight any to know any C/C++ library which allows to perform this conversion?

1

There are 1 best solutions below

0
Peter Cordes On BEST ANSWER

For 24bpp images, it's the same shuffle: reverse 3-byte chunks. For 16bpp 5:6:5 image formats, it's again the same shuffle with symmetry around the middle field.

Use any of the existing BGR to RGB functions you found.