Working from a model of Gaussian pixel noise, we present and unify over 25 years of developments in the statistical analysis of the photon transfer conversion gain measurement. We then study a two-sample estimator of the conversion gain that accounts for the general case of non-negligible dark noise. The moments of this estimator are ill-defined (their integral representations diverge), and so we propose a method for assigning pseudomoments, which are shown to agree with actual sample moments under mild conditions. A definition of optimal sample size pairs for this two-sample estimator is proposed and used to find approximate optimal sample size pairs that allow experimenters to achieve a predetermined measurement uncertainty with as little data as possible. The conditions under which these approximations hold are also discussed. Design and control of experiment procedures are developed and used to optimally estimate a per-pixel conversion gain map of a real image sensor. Experimental results show excellent agreement with theoretical predictions and are backed up with Monte Carlo simulation. The per-pixel conversion gain estimates are then applied in a demonstration of per-pixel read noise estimation of the same image sensor. The results of this work open the door to a comprehensive pixel-level adaptation of the photon transfer method.