William
William

Reputation: 71

Fast image RGB to BGR conversion

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?

Upvotes: 1

Views: 948

Answers (1)

Peter Cordes
Peter Cordes

Reputation: 365277

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.

Upvotes: 7

Related Questions