This paper presents a closed-form solution for natural image matting, a challenging task in image and video editing that involves extracting a foreground object from an image based on limited user input. The authors derive a cost function from local smoothness assumptions on foreground and background colors, eliminating these colors analytically to obtain a quadratic cost function in the alpha matte. This allows for finding the globally optimal alpha matte by solving a sparse linear system of equations. The closed-form formula enables predicting the solution's properties by analyzing the eigenvectors of a sparse matrix, similar to spectral image segmentation algorithms. The method requires minimal user input, such as sparse scribbles, to produce high-quality mattes. The paper also discusses the impact of parameters like $\varepsilon$ and window size, and provides a spectral analysis of the matting Laplacian matrix to guide user interaction. Experimental results show that the proposed method outperforms other algorithms in terms of visual quality and efficiency.This paper presents a closed-form solution for natural image matting, a challenging task in image and video editing that involves extracting a foreground object from an image based on limited user input. The authors derive a cost function from local smoothness assumptions on foreground and background colors, eliminating these colors analytically to obtain a quadratic cost function in the alpha matte. This allows for finding the globally optimal alpha matte by solving a sparse linear system of equations. The closed-form formula enables predicting the solution's properties by analyzing the eigenvectors of a sparse matrix, similar to spectral image segmentation algorithms. The method requires minimal user input, such as sparse scribbles, to produce high-quality mattes. The paper also discusses the impact of parameters like $\varepsilon$ and window size, and provides a spectral analysis of the matting Laplacian matrix to guide user interaction. Experimental results show that the proposed method outperforms other algorithms in terms of visual quality and efficiency.