This is the code of ''Chaoyan Huang, Zhi Li, Yubing Liu, Tingting Wu, Tieyong Zeng, Quaternion-based weighted nuclear norm minimization for color image restoration, Pattern Recognition,Volume 128, 2022, 108665.''. Please run main.m to reproduce Fig. 1 of the paper. qtfm_2_8 is the quaternion toolbox download from https://sourceforge.net/projects/qtfm/, please unzip it and add to your path. demof consists the functions of the proposed quaternion-based WNNM. It may take you 708.680954 seconds to run the code with iteration 8. The detailed please see the corresponding paper. Huangchy2020@163.com by Chaoyan Huang, Dec. 11, 2020.