1. A computer-implemented method for assigning attributes to an image, the method comprising: allowing a user to mark a plurality of pixels of an image as a single marked area by a single scribble, the single marked area defines, for a current iteration, a target attribute; determining according to the target attribute an optimal function that defines at least one respective attribute of pixels in the image; assigning the at least one respective attributes to pixels in the image according to the optimal function; and displaying the at least one attributes of said pixels.