Dyeing or printing processes combined with mechanical treatment