1. A method to identify locations for placing assist features using a computer, wherein the locations are identified using an inverse mask field, wherein the inverse mask field is determined by iteratively modifying a grayscale image that represents a target mask layout, and wherein the iterative modifications to the grayscale image are performed using a gradient of a cost function, the method comprising: determining a spatial sampling frequency to sample the target mask layout, wherein sampling the target mask layout at the spatial sampling frequency prevents spatial aliasing in the gradient of the cost function; generating the grayscale image by sampling the target mask layout at the spatial sampling frequency; computing the inverse mask field by, iteratively, using the gradient of the cost function to modify the grayscale image, and updating the gradient of the cost function based at least on the modified grayscale image; and identifying locations for placing assist features based at least on the inverse mask field.