Studies of absorption spectra of high-z QSOs have revealed that the intergalactic medium at z~2-3 is enriched to ~10-3 to 10-2 Zsolar for gas densities more than a few times the mean cosmic density but have not yet produced an accurate metallicity estimate or constrained variations in the metallicity with density, redshift, or spatial location. This paper discusses the ``pixel optical depth'' (POD) method of QSO spectrum analysis, using realistic simulated spectra from cosmological simulations. In this method, absorption in Lyα is compared to corresponding metal absorption on a pixel-by-pixel basis, yielding for each analyzed spectrum a single statistical correlation encoding metal enrichment information. Our simulations allow testing and optimization of each step of the technique's implementation. Tests show that previous studies have probably been limited by C IV self-contamination and O VI contamination by H I lines; we have developed and tested an effective method of correcting for both contaminants. We summarize these and other findings and provide a useful recipe for the POD technique's application to observed spectra. Our tests reveal that the POD technique applied to spectra of presently available quality is effective in recovering useful metallicity information even in underdense gas. We present an extension of the POD technique to directly recover the intergalactic metallicity as a function of gas density. For a given ionizing background, both the oxygen and carbon abundances can be measured with errors of at most a factor of a few over at least an order of magnitude in density, using a single high-quality spectrum.