During Rama II's reign western influences began to be felt in Siam.
In 1785 the British occupied Penang, and in 1819 they founded Singapore making them main western economic and political influence in Siam.
To negotiate with British Siam signed Burney Treaty agreeing to establish a uniform taxation system, to reduce taxes on foreign trade and to abolish some of the royal monopolies. It increased in trade, thus kingdom became wealthier and army better equipped.
In 1859 French occupied Saigon and started influencing Vietnam and Cambodia. Rama IV soon realized that French were more interested in territorial expansion so he gave British economic concessions they demanded in hoping to get British support.
At same time Siam took many reform Railways and telegraph lines united the previously remote and semi-autonomous provinces. The currency was tied to the gold standard and a modern system of taxation replaced the arbitrary exactions and labour service of the past
Thus Siam continued to escape colonial rule.