Quanta Image Sensor (QIS) is a binary imaging device envisioned as a candidate for the next generation image sensor after CCD and CMOS. Equipped with a massive number of single photon detectors, the sensor has a threshold $q$ above which the number of arriving photons will trigger a binary response “1”. Existing methods in the device literature typically assume that $q = 1$ for circuit simplicity. We argue that a spatially varying threshold can significantly improve the signal to noise ratio of the reconstructed image. In this paper, we present an optimal threshold design method. We make two contributions. First, we derive a set of oracle threshold results to inform the maximally achievable performance. We show that the oracle threshold should match exactly with the underlying pixel intensity. Second, we show that around the oracle threshold there exists a set of thresholds that give asymptotically unbiased reconstructions. The asymptotic unbiasedness has a phase transition behavior which allows us to develop a practical threshold update scheme using a bisection method. Experimentally, the new threshold design method achieves better rate of convergence than existing methods.