Answer the question
In order to leave comments, you need to log in
How to crop a subject in an image, getting rid of the white background?
The input data is a set of pictures with objects on a white background. It is necessary to crop the object itself from the white background, and so that after inserting the picture in any place, the space around the object remains transparent. In which direction to dig, what libraries are there (preferably Java, but C ++ or Python is also possible)? Or maybe there are ready-made solutions?
Answer the question
In order to leave comments, you need to log in
ImageMagic will save you. In any form - at least a library, at least that. And there are many languages.
A bit too much for such simple tasks, but it will allow you to do much more in case something happens: OpenCV .
In the case of a simple color replacement, is it so difficult to walk through the image matrix with a similar check:
if (rgba(i,j) == rgba_color(255,255,255,1) {
rgba(i,j) = rgba_color(0,0,0,0);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question