Nanoindentation tests performed with a sharp diamond pyramid of apical angle 35° provided very quantitative depth profiles of hardness in polyimides implanted with C, N, O, Ne or Si ions. In all cases the hardness increased steeply when the amount of deposited energy reached a value of the order of 20 eV/atom. For an amount of energy ten times higher the polymer was transformed into an amorphous hydrocarbon and the hardening factor saturated at a value of 13 to 20. But this carbonized layer was poorly adherent, as evidenced by reproducible discontinuities in the depth-versus-load curves, when the indentor tip reached the interface.