1. An apparatus of decoding an image, the apparatus comprising: an entropy decoder which obtains information about an intra prediction mode of a current block to be decoded, from a bitstream, the intra prediction mode indicating a particular direction among a plurality of directions, the particular direction being indicated by one of dx number in a horizontal direction and a fixed number in a vertical direction, and dy number in the vertical direction and a fixed number in the horizontal direction; and an intra prediction performer which obtains a number of neighboring pixels located on one side among a left side of the current block and an upper side of the current block according to a position of a current pixel and the particular direction indicated by the intra prediction mode, and one of a location of a neighboring pixel located on the left side of the current block determined based on the dy number in the vertical direction and the fixed number in the horizontal direction and a location of a neighboring pixel located on the upper side of the current block determined based on the dx number in the horizontal direction and the fixed number in the vertical direction, where dx and dy are integers according to the intra prediction mode, when the number of the neighboring pixels is 1, obtains a prediction value of the current pixel based on the neighboring pixel, and when the number of the neighboring pixels is 2, obtains the prediction value of the current pixel based on a weighted average of the neighboring pixels, wherein the dx number and the dy number are determined among {32, 26, 21, 17, 13, 9, 5, 2, 0, −2, −5, −9, −17, −21, −26} according to the intra prediction mode of the current block, wherein the fixed integer number is power of 2, wherein: the image is split into a plurality of maximum coding units, according to information about a maximum size of a coding unit, a maximum coding unit, from among the plurality of maximum coding units, is hierarchically split into one or more coding units of depths according to split information, a coding unit of a current depth is one of rectangular data units split from a coding unit of an upper depth, when the split information indicates a split for the current depth, the coding unit of the current depth is split into coding units of a lower depth, independently from neighboring coding units, when the split information indicates a non-split of the current depth, one or more prediction units are obtained from the coding unit of the current depth, and the weighted average is determined based on one of the dx number and the dy number and the location of one or more neighboring pixels.