Generation and transformation of light