Solar energy is widely used in photovoltaic power generation as a kind of clean energy. However, the liquid film, frosting, and icing on the photovoltaic module seriously limit the efficiency of photovoltaic power generation. We developed a composite coating (Y6-NanoSH) by combining an in situ photothermal and transparent Y6 organic film with a nanosuperhydrophobic material. The Y6-NanoSH coated glass exhibited excellent optical clarity both indoors and outdoors, indicating that the coating holds great promise in anti-icing applications for photovoltaic panels. The Y6-NanoSH coating absorbs very little visible light but instead absorbs in the near-infrared region, thereby emitting heat. When exposed to sunlight, the Y6-NanoSH coated photovoltaic panel raises its surface temperature, inhibiting the growth and accumulation of ice and frost on its surface. This is achieved through a combination of photothermal emission and superhydrophobic repellency, which promotes the evaporation and rolling away of water droplets. This validates our success in developing a photothermal, transparent, and superhydrophobic coating with excellent anti-icing capabilities, suitable for use on photovoltaic panels, as well as potential applications in car windscreens, transmission lines, curtain walls, and weather radomes.