Error with command catalog:images:resize
If you noticed that your images have not appeared on your Magento2 site you can check the log file. There you can see the error below
imagecolorsforindex(): Argument #2 ($color) is out of range#0
This error happens because the PHP library GD2 for PHP 8.1 has a bug.
For fixing this issue you should run the command below
bin/magento config:set dev/image/default_adapter IMAGEMAGICK