We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
Error with command catalog:images:resize
October 21, 2022

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
/vendor/magento/framework/Image/Adapter/Gd2.php(347): imagecolorsforindex()
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