Dye-containing polymers P1 (PEDPP-OT-BDT) and P2 (PEDPP-OT-BDTT) including a π-extended diketopyropyrrole (DPP) derivative and electron-rich thiophene fused ring units (4,8-bis((2-ethylhexyl)oxy)benzo[1,2-b:4,5-b']dithiophene for P1 and 4,8-bis(5-(2-ethylhexyl)thiophen-2-yl)benzo[1,2-b:4,5-b']dithiophene for P2) were synthesized as narrow band gap dyes. A π-extended DPP (EDPP-OT-BrPh), fragment of the polymers P1 and P2, was obtained by extending the π-conjugation of DPP using Ru(III)-catalyzed C-H and N-H activation reported by Gońka et al. in 2019, exhibiting a high quantum yield (ϕem=0.84) and small HOMO-LUMO gap (Eg=1.69 eV) due to the spatial overlap of the HOMO and LUMO orbitals. The solubility of the π-extended DPP was improved by introducing four 2-octylthophene side chains around the periphery of the planer dye moiety, while maintaining the high planarity of the dye molecule, which is essential to the function of optoelectronic devices. As a result, P1 and P2, polymerized with the π-extended DPP and BDT derivatives, exhibit carrier mobility of approximately 10-5 cm2/Vs in organic field-effect transistors (OFETs). In bulk heterojunction (BHJ) solar cells with [6,6]-phenyl-C61-butyric acid methyl ester (PCBM), they demonstrate a power conversion efficiency (PCE) of 1.0 % with an average transmittance (AVTs) of around 60 %.