We present a study of the galaxy population predicted by hydrodynamical simulations of galaxy clusters. These simulations, which are based on the gadget-2tree + sph code, include gas cooling, star formation, a detailed treatment of stellar evolution and chemical enrichment, as well as supernova energy feedback in the form of galactic winds. As such, they can be used to extract the spectrophotometric properties of the simulated galaxies, which are identified as clumps in the distribution of star particles. Simulations have been carried out for a representative set of 19 cluster-sized haloes, having mass M200 in the range 5 × 1013–1.8 × 1015 h−1 M⊙. All simulations have been performed for two choices of the stellar initial mass function (IMF), namely using a standard Salpeter IMF with power-law index x= 1.35, and a top-heavy IMF with x= 0.95. In general, we find that several of the observational properties of the galaxy population in nearby clusters are reproduced fairly well by simulations. A Salpeter IMF is successful in accounting for the slope and the normalization of the colour–magnitude relation for the bulk of the galaxy population. In contrast, the top-heavy IMF produces too red galaxies, as a consequence of their exceedingly large metallicity. Simulated clusters have a relation between mass and optical luminosity, which generally agrees with observations, both in normalization and in slope. Also in keeping with observational results, galaxies are generally bluer, younger and more star forming in the cluster outskirts. However, we find that our simulated clusters have a total number of galaxies which is significantly smaller than the observed one, falling short by about a factor of 2–3. We have verified that this problem does not have an obvious numerical origin, such as lack of mass and force resolution. Finally, the brightest cluster galaxies are always predicted to be too massive and too blue, when compared to observations. This is due to gas overcooling, which takes place in the core regions of simulated clusters, even in the presence of the rather efficient supernova feedback used in our simulations.