It has been a long-term effort to get higher energy resolution for experiment detector. Usually the energy resolution can be converted from spatial resolution though mechanical setup. To shrink pixel size of detector takes a lot of efforts, time and is limited by integrated circuit technology. So centroid algorithm is widely used to increase spatial resolution. Through electron cloud diffusion, the excited electrons are distributed among nearby pixels. Using centroid algorithm, the photon impact point can be calculated. However, the accuracy of calculated position is affected by relative impact position within pixel and signal to noise ratio (SNR). There is a systematic bias offset, or edge effect, toward pixel center when the impact point is near perimeter of pixel. Also the SNR is an important factor which affects the accuracy of calculated position. In this study, we try to calculate the simulated photon event positions by three algorithms, 3x3 centroid, 5x5 centroid and two-dimensional Gaussian profile fit. A simulation 2000 x 1000 pixels’ image with specific SNR is filled with noise first and then sparsely and randomly distributed with 200 Gaussian shaped photon impact events to avoid pile up. Since the original impact points are well known, the calculated positions of photon event can be compared with the original data to verify their accuracy. The noise, or SNR, can also be adjusted for different images to see its effects on the accuracy. The simulation shows the systematic bias toward pixel center for centroid algorithm as seen in the previous experiment using 3x3 centroid. For 3x3 centroid, the bias will not disappear even when SNR is high. 5x5 centroid is better than 3x3 centroid when SNR is high but the position accuracy degrades faster when image SNR decreases. The 2D-Gaussian fit can provide better position estimation at the same SNR and systematic bias of position at perimeter of pixel is minimized. However, the iteration process will diverge and no optimized answer can be attained when SNR is too low. The accuracy of calculated position, defined as inverse of position error standard deviation, is proportional to SNR for 5x5 and 2-D Gaussian fit.