It is easier to read dark text on a bright background (positive polarity) than to read bright text on a dark background (negative polarity). This positive-polarity advantage is often linked to pupil size: A bright background induces small pupils, which in turn increases visual acuity. Here we report that pupil size, when manipulated through peripheral brightness, has qualitatively different effects on discrimination of fine stimuli in central vision and detection of faint stimuli in peripheral vision. Small pupils lead to improved discrimination performance, consistent with the positive-polarity advantage, but only for very small stimuli that are at the threshold of visual acuity. In contrast, large pupils lead to improved detection performance.These results are likely due to two pupil-size related factors: Small pupils increase visual acuity, which improves discrimination of fine stimuli; and large pupils increase light influx, which improves detection of faint stimuli. Light scatter is likely also a contributing factor: When a display is bright, light scatter creates a diffuse veil of retinal illumination that reduces image contrast, thus impairing detection performance. We further found that pupil size was larger during the detection task than during the discrimination task, even though both tasks were equally difficult and similar in visual input; this suggests that the pupil may automatically assume an optimal size for the current task. Our results may explain why pupils dilate in response to arousal: This may reflect an increased emphasis on detection of unpredictable danger, which is crucially important in many situations that are characterized by high levels of arousal. Finally, we discuss the implications of our results for the ergonomics of display design.