File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,7 @@ namespace dlib
262262 else if (is_image<float >(src)) assign_image (dest, numpy_image<float >(src));
263263 else if (is_image<double >(src)) assign_image (dest, numpy_image<double >(src));
264264 else if (is_image<rgb_pixel>(src)) assign_image (dest, numpy_image<rgb_pixel>(src));
265+ else if (is_image<rgb_alpha_pixel>(src)) assign_image (dest, numpy_image<rgb_alpha_pixel>(src));
265266 else DLIB_CASSERT (false , " Unsupported pixel type used in assign_image()." );
266267 }
267268
Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ 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)
24+ {
25+ numpy_image<rgb_alpha_pixel> img;
26+ load_image (img, path);
27+ return img;
28+ }
29+
2330numpy_image<unsigned char > load_grayscale_image (const std::string &path)
2431{
2532 numpy_image<unsigned char > img;
@@ -168,6 +175,10 @@ void bind_numpy_returns(py::module &m)
168175 " Saves the given image to the specified path. Determines the file type from the file extension specified in the path" ,
169176 py::arg (" img" ), py::arg (" filename" ), py::arg (" quality" ) = 75
170177 );
178+ m.def (" save_image" , &save_image<rgb_alpha_pixel>,
179+ " Saves the given image to the specified path. Determines the file type from the file extension specified in the path" ,
180+ py::arg (" img" ), py::arg (" filename" ), py::arg (" quality" ) = 75
181+ );
171182 m.def (" save_image" , &save_image<unsigned char >,
172183 " Saves the given image to the specified path. Determines the file type from the file extension specified in the path" ,
173184 py::arg (" img" ), py::arg (" filename" ), py::arg (" quality" ) = 75
You can’t perform that action at this time.
0 commit comments