1. A method of transforming an image, the method comprising: selecting a frequency transform algorithm to be used for a current block from a plurality of frequency transform algorithms according to a result obtained by transforming frequencies of peripheral blocks adjacent to, and non-overlapping with, the current block; and transforming the current block into a frequency domain by using the selected frequency transform algorithm, wherein the selecting the frequency transform algorithm to be used for the current block comprises: selecting a first frequency transform algorithm, from the plurality of frequency transform algorithms, in response to the result obtained by transforming the frequencies of the peripheral blocks being a first result, and selecting a second frequency transform algorithm, from the plurality of frequency transform algorithms, in response to the result obtained by transforming the frequencies of the peripheral blocks being a second result, different from the first result.