1. A method comprising: using an electronic processor, computing a first cost function for a first nonpixelated mask to obtain a first value; altering the first nonpixelated mask in a frequency domain to obtain a second nonpixelated mask; using the electronic processor, computing the first cost function for the second nonpixelated mask to obtain a second value; generating a second cost function by applying a quantization function to the second nonpixelated mask, wherein the quantization function regularizes a mask value of the second nonpixelated mask to one of at least two bias quantization values, wherein the second cost function is biased using any bias value in a range, and the quantization function comprises a continuous curve and a shape comprising for values less than a first bias value of the at least two bias values, a slope of the continuous curve is negative until a first minima point at the first bias value.