1. A method for compressing an image, said method comprising: determining a number of non-zero AC coefficients for a component transform and the locations of the non-zero AC coefficients in a transform block; selecting one of a plurality of coding modes in response to the number of non-zero AC coefficients and the locations of the non-zero AC coefficients satisfying predetermined criteria, wherein the plurality of coding modes comprise different bit allocations from each other; and coding locations and values of the non-zero AC coefficients and a DC coefficient for the component transform according to the selected coding mode, to thereby compress the image.