Skip to content

Commit ca7fd9d

Browse files
authored
Actually load rgb_alpha images. (#2942)
This should've been added in #2925. The only doubt I have around the function name: - `load_rgb_alpha_image`: following the `rgb_alpha_pixel` in dlib - `load_rgba_image`: shorter and maybe nicer?
1 parent 8edfa54 commit ca7fd9d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/python/src/numpy_returns.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ numpy_image<rgb_pixel> load_rgb_image (const std::string &path)
2020
return img;
2121
}
2222

23-
numpy_image<rgb_pixel> load_rgb_alpha_image (const std::string &path)
23+
numpy_image<rgb_alpha_pixel> load_rgb_alpha_image (const std::string &path)
2424
{
2525
numpy_image<rgb_alpha_pixel> img;
2626
load_image(img, path);
@@ -166,6 +166,11 @@ void bind_numpy_returns(py::module &m)
166166
py::arg("filename")
167167
);
168168

169+
m.def("load_rgb_alpha_image", &load_rgb_alpha_image,
170+
"Takes a path and returns a numpy array (RGBA) containing the image",
171+
py::arg("filename")
172+
);
173+
169174
m.def("load_grayscale_image", &load_grayscale_image,
170175
"Takes a path and returns a numpy array containing the image, as an 8bit grayscale image.",
171176
py::arg("filename")

0 commit comments

Comments
 (0)