Perylenetetracarboxylic diimide derivatives bearing 2- or 4-peripheral pyrrole pendants could be efficiently crosslinked to form an insoluble film either by electropolymerization or visible light induced oxidative photopolymerization of the pyrrole units.