## 6 Impact on the Speed of Hologram Generation  
Although the image quality metrics do not affect the convergence speed of the IFTAs for the hologram generation, however, all the IFTAs rely on the image quality metrics to know when they should terminate the iterations, i.e., when further iterations would not yield improvement in the image quality, especially the perceived image quality. In the first test, the GS algorithms using the RMSE or SSIM as the image quality metrics were used to generate the phase-only holograms for the 29 natural images in the LIVE Image Quality Assessment Database. The algorithm would terminate when it reaches convergence, i.e., when the image quality metric varies less than 10% for the past ten consecutive iterations. The required number of iterations for each image were plotted in Figure 9 for both image quality metrics. It can be seen that the GS algorithm using SSIM as the image quality metric converges more quickly for 18 out of the 29 tested images than the same algorithm based on the RMSE. The same analysis was carried out for the Fienup and FiDOC algorithms based on RMSE and SSIM. The results were plotted in Figures 10 and 11. For the Fienup algorithm, SSIM would terminate the iterations quicker for 24 out of the 29 tested images. For the FiDOC algorithm, the SSIM would terminate the iterations quicker for 28 out of the 29 tested images. It can be seen that the SSIM is able to terminate the iterations more quickly in all the three IFTAs. Figure 12 plots the average number of iterations required in each IFTA configuration. For the 29 images tested in this study, the performance of GS and Fienup algorithms were similar when RMSE was used as the image quality metric. The use of SSIM reduced the number of required iterations in GS and Fienup algorithms by 25% and 50%, respectively. FiDOC algorithm was able to significantly improve the calculation speed on its own, which was consistent with previous results [18; 19]. In addition to this, SSIM was able to further reduce the required number of iterations by 75% in the FiDOC algorithm, compared to when RMSE was used as the image quality metric. Figure 9: The required number of iterations to reach the convergence for the GS algorithms based on RMSE and SSIM. Figure 11: The required number of iterations to reach the convergence for the FiDOC algorithms based on RMSE and SSIM. Figure 12: The average number of iterations required for GS, Fienup and FiDOC algorithms based on RMSE and SSIM. Figure 10: The required number of iterations to reach the convergence for the Fienup algorithms based on RMSE and SSIM. The don't-care area used in the FiDOC algorithm increases the dimensions of the image, which makes the calculation time for each iteration longer. Figure 13 plots the average calculation time for the 29 test images using different algorithm settings. The calculation was carried out in MATLAB 2019a on a Windows 10 PC with Intel i9-9820x processor and 128 GB RAM. When RMSE is used as the image quality metric, FiDOC algorithm is actually the slowest despite the minimal number of iterations required. When SSIM is used as the image quality metric, the reduction of the iteration number by the FiDOC algorithm can actually lead to improvement in the calculation speed. In order to further validate the results, McGill Calibrated Colour Image Database [32] was used to compare the performance of FiDOC algorithm using RMSE or SSIM as the image quality metrics. This database contained over 1500 images, which made the results more representative. Figure 14 plots the average iterations among all the images using the two algorithm configurations under comparison. It can be seen that SSIM was able to reduce the required number of iterations by over two-thirds, when compared with the RMSE. This is consistent with results obtained based on the LIVE Image Quality Assessment Database in general. It should be stressed again that the SSIM as an image quality metric does not speed up the IFTAs themselves.