This paper analyzes portfolio diversification for nonlinear transformations of heavy-tailed risks. It is shown that diversification of a portfolio of convex functions of heavy-tailed risks increases the portfolio's riskiness, if expectations of these risks are infinite. On the contrary, for concave functions of heavy-tailed risks with finite expectations, the stylized fact that diversification is preferable continues to hold. The framework of transformations of heavy-tailed risks includes many models with Pareto-type distributions that exhibit local or moderate deviations from power tails in the form of additional slowly varying or exponential factors. The class of distributions under study is therefore extended beyond the stable class.