Restoring binary images is a problem which arises in various application fields. In our paper, this problem is considered in a variational framework: the sought-after solution minimizes an energy. Energies defined over the set of the binary images are inevitably nonconvex and there are no general methods to calculate the global minimum, while local minimziers are very often of limited interest. In this paper we define the restored image as the global minimizer of the total-variation (TV) energy functional constrained to the collection of all binary-valued images. We solve this constrained non-convex optimization problem by deriving another functional which is convex and whose (unconstrained) minimum is proven to be reached for the global minimizer of the binary constrained TV functional. Practical issues are discussed and a numerical example is provided.