Purpose: To develop a framework for taking the spatial frequency composition of an imaging taskinto account when determining optimal bin weight factors for photon counting energy sensitivex-ray systems. A second purpose of the investigation is to evaluate the possible improvement comparedto using pixel based weights.Methods: The Fourier based approach of imaging performance and detectability index d0 is appliedto pulse height discriminating photon counting systems. The dependency of d0 on the bin weightfactors is made explicit, taking into account both differences in signal and noise transfer characteristicsacross bins and the spatial frequency dependency of interbin correlations from reabsorbedscatter. Using a simplified model of a specific silicon detector, d0 values for a high and a low frequencyimaging task are determined for optimal weights and compared to pixel based weights.Results: The method successfully identifies bins where a large point spread function degradesdetection of high spatial frequency targets. The method is also successful in determining how todownweigh highly correlated bins. Quantitative predictions for the simplified silicon detectormodel indicate that improvements in the detectability index when applying task-based weightsinstead of pixel based weights are small for high frequency targets, but could be in excess of 10%for low frequency tasks where scatter-induced correlation otherwise degrade detectability.Conclusions: The proposed method makes the spatial frequency dependency of complex correlationstructures between bins and their effect on the system detective quantum efficiency easier toanalyze and allows optimizing bin weights for given imaging tasks. A potential increase in detectabilityof double digit percents in silicon detector systems operated at typical CT energies (100kVp) merits further evaluation on a real system. The method is noted to be of higher relevancefor silicon detectors than for cadmium (zink) telluride detectors.