Morphine

Grey = Carbon
White = Hydrogen
Red = Oxygen
Blue = Nitrogen

Highlight the flat benzene ring

Highlight the -OH group that is replaced by -OCH3 to make codeine

Highlight the -OH groups that are replaced by -OCOCH3 to make heroin

Highlight nitrogen-containing amine group

Return the molecule to normal