This paper proposes a subpixel transformation method to correct Keystone and Smile distortions in fiber spectral images from the Fiber Arrayed Solar Optical Telescope. These distortions affect the spatial and spectral positions, degrading resolution and accuracy. To correct Keystone distortion, we use a local summation and peak-finding method to locate central horizontal coordinates, calculate shifting values, and straighten the curves. For Smile distortion, we use quartic polynomial fitting based on absorption lines at different wavelengths. This technique preserves subpixel components, redistributes pixel values, and interpolates non-fiber portions, rectifying the spectra for accurate analysis. The method can also be applied to other astronomical projects like Large Sky Area Multi-Object Fiber Spectroscopic Telescope, enhancing the accuracy and reliability of spectral data in various astronomical studies.