A computer- implemented method, the method comprising: obtaining a first image depicting at least a foreground item; subsampling the first image to a first level image of a multiscale transform; performing based on a machine learning model, an identification of a foreground portion of the first level image and a background portion of the first level image; generating based on the identification of the foreground portion and the background portion, a first mask ; upscaling the first mask to a resolution corresponding to the first image depicting the foreground item; applying the upscaled first mask to the first image to form a second image, the second image depicting the foreground item with at least a portion of the background portion of the second image removed; providing the second image depicting the foreground item to a publication system ; causing display of the first mask; wherein the method is characterized in that it comprises: receiving an indication of a scribble on the first mask, to obtain a scribble mask indicating which portion of the first mask to remove or add from the first mask ; dilating the scribble mask ; apply a domain transform filter to the first image to refine the image around boundary regions; binarizing and thresholding the filtered image to form a binarized and thresholded image; applying the dilated scribble mask to the binarized and thresholded image to form a filtered scribble mask ; combining the first mask with the filtered scribble mask to form an updated mask ; and applying the updated mask to the first image . obtaining a first image depicting at least a foreground item; subsampling the first image to a first level image of a multiscale transform; performing based on a machine learning model, an identification of a foreground portion of the first level image and a background portion of the first level image; generating based on the identification of the foreground portion and the background portion, a first mask ; upscaling the first mask to a resolution corresponding to the first image depicting the foreground item; applying the upscaled first mask to the first image to form a second image, the second image depicting the foreground item with at least a portion of the background portion of the second image removed; providing the second image depicting the foreground item to a publication system ; causing display of the first mask; wherein the method is characterized in that it comprises: receiving an indication of a scribble on the first mask, to obtain a scribble mask indicating which portion of the first mask to remove or add from the first mask ; dilating the scribble mask ; apply a domain transform filter to the first image to refine the image around boundary regions; binarizing and thresholding the filtered image to form a binarized and thresholded image; applying the dilated scribble mask to the binarized and thresholded image to form a filtered scribble mask ; combining the first mask with the filtered scribble mask to form an updated mask ; and applying the updated mask to the first image . receiving an indication of a scribble on the first mask, to obtain a scribble mask indicating which portion of the first mask to remove or add from the first mask ; dilating the scribble mask ; apply a domain transform filter to the first image to refine the image around boundary regions; binarizing and thresholding the filtered image to form a binarized and thresholded image; applying the dilated scribble mask to the binarized and thresholded image to form a filtered scribble mask ; combining the first mask with the filtered scribble mask to form an updated mask ; and applying the updated mask to the first image . <EOS>