File size: 3,278 Bytes
36c95ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
kornia.color
============

.. currentmodule:: kornia.color

The functions in this section perform various color space conversions.

.. note::
   Check a tutorial for color space conversions `here <https://kornia-tutorials.readthedocs.io/en/latest/
   hello_world_tutorial.html>`__.


Grayscale
---------

.. tip::
    Learn more: https://en.wikipedia.org/wiki/Grayscale

.. autofunction:: rgb_to_grayscale
.. autofunction:: bgr_to_grayscale
.. autofunction:: grayscale_to_rgb

.. autoclass:: GrayscaleToRgb
.. autoclass:: RgbToGrayscale
.. autoclass:: BgrToGrayscale

RGB
---

.. tip::
    Learn more: https://en.wikipedia.org/wiki/RGB_color_model

.. autofunction:: rgb_to_bgr
.. autofunction:: bgr_to_rgb

.. autofunction:: rgb_to_linear_rgb
.. autofunction:: linear_rgb_to_rgb

.. autoclass:: RgbToBgr
.. autoclass:: BgrToRgb

.. autoclass:: LinearRgbToRgb
.. autoclass:: RgbToLinearRgb

RGBA
----

.. tip::
    Learn more: https://en.wikipedia.org/wiki/RGBA_color_model

.. autofunction:: bgr_to_rgba
.. autofunction:: rgb_to_rgba
.. autofunction:: rgba_to_rgb
.. autofunction:: rgba_to_bgr

.. autoclass:: RgbToRgba
.. autoclass:: BgrToRgba
.. autoclass:: RgbaToRgb
.. autoclass:: RgbaToBgr

HLS
---

.. tip::
    Learn more: https://en.wikipedia.org/wiki/HSL_and_HSV

.. autofunction:: rgb_to_hls
.. autofunction:: hls_to_rgb

.. autoclass:: RgbToHls
.. autoclass:: HlsToRgb

HSV
---

.. tip::
    Learn more: https://en.wikipedia.org/wiki/HSL_and_HSV

.. autofunction:: rgb_to_hsv
.. autofunction:: hsv_to_rgb

.. autoclass:: RgbToHsv
.. autoclass:: HsvToRgb

LUV
---

.. tip::
    Learn more: https://en.wikipedia.org/wiki/CIELUV

.. autofunction:: rgb_to_luv
.. autofunction:: luv_to_rgb

.. autoclass:: RgbToLuv
.. autoclass:: LuvToRgb

Lab
---

.. tip::
    Learn more: https://en.wikipedia.org/wiki/CIELAB_color_space

.. autofunction:: rgb_to_lab
.. autofunction:: lab_to_rgb

.. autoclass:: RgbToLab
.. autoclass:: LabToRgb

YCbCr
-----

.. tip::
    Learn more: https://en.wikipedia.org/wiki/YCbCr

.. autofunction:: rgb_to_ycbcr
.. autofunction:: ycbcr_to_rgb

.. autoclass:: YcbcrToRgb
.. autoclass:: RgbToYcbcr

YUV
---

.. tip::
    Learn more: https://en.wikipedia.org/wiki/YUV

.. autofunction:: rgb_to_yuv
.. autofunction:: yuv_to_rgb

.. autoclass:: RgbToYuv
.. autoclass:: YuvToRgb

YUV420
------

.. tip::
    Learn more: https://en.wikipedia.org/wiki/YUV

.. tip::
    Learn more: https://en.wikipedia.org/wiki/Chroma_subsampling

.. autofunction:: rgb_to_yuv420
.. autofunction:: yuv420_to_rgb

.. autoclass:: RgbToYuv420
.. autoclass:: Yuv420ToRgb

YUV422
------

.. tip::
    Learn more: https://en.wikipedia.org/wiki/YUV

.. tip::
    Learn more: https://en.wikipedia.org/wiki/Chroma_subsampling

.. autofunction:: rgb_to_yuv422
.. autofunction:: yuv422_to_rgb

.. autoclass:: RgbToYuv422
.. autoclass:: Yuv422ToRgb

XYZ
---

.. tip::
    Learn more: https://en.wikipedia.org/wiki/CIELUV

.. autofunction:: rgb_to_xyz
.. autofunction:: xyz_to_rgb

.. autoclass:: RgbToXyz
.. autoclass:: XyzToRgb

Bayer RAW
---------

.. tip::
    Learn more: https://en.wikipedia.org/wiki/Bayer_filter

.. autoclass:: CFA
    :members:
    :undoc-members:

.. autofunction:: rgb_to_raw
.. autofunction:: raw_to_rgb

.. autoclass:: RawToRgb
.. autoclass:: RgbToRaw