On update to PHP 8.1, my hosting provider reset the PHP extensions to the default value.
Also, I installed Xampp with the fresh configuration without enabling the "gd" extension
I enabled the "gd" extension, it is working fine now.
I was blaming PHP 8.1 without digging deep into the issue. :p
Thanks for the reply, otherwise I was unable to figure out the issue.
[solved]