In-line X-ray phase contrast imaging, which is simple to experiment with, provides significantly higher sensitivity, compared to conventional X-ray absorption imaging. The inversion of the relationship between recorded Fresnel diffraction intensity and the phase shift induced by the object is called phase retrieval. The transport of intensity equation (TIE), a simple method of phase retrieval, which is solved by the fast Fourier transform algorithm proposed by Paganin et al., has been widely adopted. However, the existing method suffers from excessive suppression of high-frequency information, resulting in loss of image details after phase retrieval, or insufficient detail contrast, leading to blurry images. Here, we present a straightforward extension of the two-distance FFT-TIE method by modifying the Fourier filter through the use of a five-point approximation to calculate the inverse Laplacian in a discrete manner. Additionally, we utilize a combination of continuous Fourier transform and a four-point approximation to compute the gradient operator. The method is evaluated by simulating samples with a shape similar to the resolution test map and by using a photograph of a dog for further evaluation. The algorithm that incorporates the modified gradient operator and the algorithm that solely utilizes the continuous Fourier transform for gradient computation were compared with the results obtained using the two-distance FFT-TIE method. The comparisons were conducted using the results obtained from two distances from the sample to the detector. The results show that this method improves the contrast of spatial details and reduces the suppression of high spatial frequencies compared to the two-distance FFT-TIE method. Furthermore, in the low-frequency domain, our algorithm does not lose much information compared to the original method, yielding consistent results. Furthermore, we conducted our experiments using carbon rods. The results show that both our method and the FFT-TIE method exhibit low-frequency distortion due to the requirement of close proximity between the absorption maps and the detector. However, upon closer inspection, our proposed method demonstrates superior accuracy in reproducing the finer details of the carbon rod fibers.