Under Display Camera(UDC) technology is being developed to eliminate camera holes and place cameras behind display panels according to full display trend in mobile phone. However, these camera systems cause attenuation and diffraction as light passes through the panel, which is inevitable to deteriorate the camera image. In particular, the deterioration of image quality due to diffraction and flares is serious, in this regard, this paper discusses techniques for restoring it. The diffraction compensation algorithm in this paper is aimed at real-time processing through HW implementation in the sensor for preview and video mode, and we've been able to use effective techniques to reduce computation by about 40 percent.