Blue energy relies on the chemical potential difference between solutions of high and low ionic concentrations, potentially providing an independent energy source at estuaries around the world. The energy conversion relies on reverse electrodialysis via ion-selective membranes. A novel generation of these membranes is based on nanopores in atomically thin material. Single nanopores in molybdenum disulfide (MoS2)-based membranes have shown record-high power outputs in alkaline conditions. By increasing the surface charge of MoS2 membranes by light, we can double the osmotic power generated by a single nanopore at a neutral pH. The increased surface charge at the pore rim enhances the ion selectivity and leads to a larger osmotic voltage (dominating in small pores), while the increased surface charge of the membrane enhances the surface conductance, leading to a larger osmotic current (dominating in larger pores). The combination of these effects could efficiently boost the energy generation using membranes containing arrays of nanopores of varying sizes.