Size quantization effects on excitonic optical transitions are studied by optical absorption experiments on sodium borosilicate glasses doped with CdS, CdSe or CdTe nanocrystals. The original sol-gel synthesis procedure involves the preparation of complex cadmium-based molecules in an aqueous solution to which other inorganic precursors are added, in order to start the gelation of the vitreous matrix. The formation of semiconductor crystallites is achieved by a redox reaction, during the thermal degradation of the gel, which is then melted and quenched to provide the glass. The effects of thermal annealing, at temperatures around and above the Tg of the glass, are investigated by spectroscopic measurements. The latter are analysed by using a calculation of excitonic energies and oscillator strengths, based on the envelope-function approximation, including the confinement-induced mixing of valence-band states. Our studies show that disorganised clusters with a rather narrow size-distribution, controlled by initial conditions, are present before the annealing, which rapidly improves the crystalline quality. Meanwhile, the width of the size-distribution function is reduced down to an optimum, after a few hours of treatment.