If the threshold is high enough, the detected region of the magic wand tool can spill out to the transparent region around the image. Restrict the contour of the detected region like this: Loop over the sketch image here (after gaussian blur has been applied) and set all pixels to 0 that are transparent in the snapshot.
If the threshold is high enough, the detected region of the magic wand tool can spill out to the transparent region around the image. Restrict the contour of the detected region like this: Loop over the sketch image here (after gaussian blur has been applied) and set all pixels to 0 that are transparent in the
snapshot
.