Metal nanoparticles (NPs) are heavily involved in photocatalytic transformations to manipulate charge separation and storage, yet the catalytic role of metal NPs in tuning the selectivity of photoreactions is rarely addressed. Here, the photodehydrogenative coupling of primary amines is selected as the model reaction to probe the catalytic role of Pt and Pd NPs supported on graphitic carbon nitride (Pt/C3N4 and Pd/C3N4). When Pt/C3N4 is employed as the photocatalyst, imine is produced via dehydrogenative homocoupling of primary amines owing to the weak adsorption of photogenerated imines and H atoms on Pt NPs. In comparison, Pd/C3N4 promotes the consecutive hydrogenation of photogenerated imines into secondary amines due to a strong affinity of both imine and H atom for the surface of Pd NPs. This strategy is applicable for the synthesis of a series of imines and secondary amines with high yields.