Codeine can be extracted from opium . Today , most codeine is synthesized from morphine through the process of O-methylation . While codeine can be directly extracted from opium , its original source , most codeine is synthesized from morphine through the process of O-methylation .