<story><title>Why OpenCV uses BGR color space (2015)</title><url>https://www.learnopencv.com/why-does-opencv-use-bgr-color-format/</url></story><parent_chain></parent_chain><comment><author>cesarb</author><text>&amp;gt; E.g. in Windows, when specifying color value using COLORREF they use the BGR format 0x00bbggrr.&lt;p&gt;Wait a little bit... isn&amp;#x27;t Windows little-endian [1]? Following the link in that sentence:&lt;p&gt;&amp;gt; typedef DWORD COLORREF;&lt;p&gt;&amp;gt; The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue.&lt;p&gt;Given that Windows is and has always been little-endian, the byte order of a COLORREF is red first, then green, then blue, that is, the order is RGB. So the reason for BGR can&amp;#x27;t be Windows&amp;#x27; COLORREF.&lt;p&gt;[1] &amp;quot;A decision was made VERY long ago that Windows would not be ported to a big-endian processor.&amp;quot; &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;blogs.msdn.microsoft.com&amp;#x2F;larryosterman&amp;#x2F;2005&amp;#x2F;06&amp;#x2F;07&amp;#x2F;the-endian-of-windows&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;blogs.msdn.microsoft.com&amp;#x2F;larryosterman&amp;#x2F;2005&amp;#x2F;06&amp;#x2F;07&amp;#x2F;th...&lt;/a&gt;</text></comment>
<story><title>Why OpenCV uses BGR color space (2015)</title><url>https://www.learnopencv.com/why-does-opencv-use-bgr-color-format/</url></story><parent_chain></parent_chain><comment><author>kalenx</author><text>Well, not only it is quite long just to say &amp;quot;BGR was used a lot back then&amp;quot;, even the back story is wrong : &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.snopes.com&amp;#x2F;fact-check&amp;#x2F;horses-pass&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.snopes.com&amp;#x2F;fact-check&amp;#x2F;horses-pass&amp;#x2F;&lt;/a&gt;</text></comment>