Head computed tomography (CT) plays an important role in the comprehensive evaluation of acute stroke. Photon-counting spectral detectors, as promising candidates for use in the next generation of x-ray CT systems, allow for assigning more weight to low-energy x-rays that generally contain more contrast information. Most importantly, the spectral information can be utilized to decompose the original set of energy-selective images into several basis function images that are inherently free of beam-hardening artifacts, a potential advantage for further improving the diagnosis accuracy. We are developing a photon-counting spectral detector for CT applications. The purpose of this work is to determine the optimal beam quality for material decomposition in two head imaging cases: nonenhanced imaging and K-edge imaging. A cylindrical brain tissue of 16-cm diameter, coated by a 6-mm-thick bone layer and 2-mm-thick skin layer, was used as a head phantom. The imaging target was a 5-mm-thick blood vessel centered in the head phantom. In K-edge imaging, two contrast agents, iodine and gadolinium, with the same concentration ([Formula: see text]) were studied. Three parameters that affect beam quality were evaluated: kVp settings (50 to 130kVp), filter materials ([Formula: see text] to 83), and filter thicknesses [0 to 2 half-value layer (HVL)]. The image qualities resulting from the varying x-ray beams were compared in terms of two figures of merit (FOMs): squared signal-difference-to-noise ratio normalized by brain dose ([Formula: see text]) and that normalized by skin dose ([Formula: see text]). For nonenhanced imaging, the results show that the use of the 120-kVp spectrum filtered by 2 HVL copper ([Formula: see text]) provides the best performance in both FOMs. When iodine is used in K-edge imaging, the optimal filter is 2 HVL iodine ([Formula: see text]) and the optimal kVps are 60kVp in terms of [Formula: see text] and 75kVp in terms of [Formula: see text]. A tradeoff of 65kVp was proposed to lower the potential risk of skin injuries if a relatively long exposure time is necessarily performed in the iodinated imaging. In the case of gadolinium imaging, both SD and BD can be minimized at 120kVp filtered with 2 HVL thulium ([Formula: see text]). The results also indicate that with the same concentration and their respective optimal spectrum, the values of [Formula: see text] and [Formula: see text] in gadolinium imaging are, respectively, around 3 and 10 times larger than those in iodine imaging. However, since gadolinium is used in much lower concentrations than iodine in the clinic, iodine may be a preferable candidate for K-edge imaging.