Photonic topology optimization is a technique used to find the electric permittivity distribution of a device that optimizes an electromagnetic figure-of-merit. Two common techniques are used: continuous density-based optimizations that optimize a grey-scale permittivity defined over a grid, and discrete level-set optimizations that optimize the shape of the material boundary of a device. More recently, continuous optimizations have been used to find an initial seed for a concluding level-set optimization since level-set techniques tend to benefit from a well-performing initial structure. However, continuous optimizations are not guaranteed to yield sufficient initial seeds for subsequent level-set optimizations, particularly for high-contrast structures, since they are not guaranteed to converge to solutions that resemble only two discrete materials. In this work, we present a method for constraining a continuous optimization such that it converges to a discrete solution. This is done by inserting a constrained sub-optimization at each iteration of an overall gradient-based optimization. This technique can be used purely on its own to optimize a device, or it can be used to provide a nearly discrete starting point for a level-set optimization.