With the help of lazyFox and bfavaretto I found the problem:
I took a look at my info.php
that I created and put in the root folder:
<?php
phpinfo();
?>
And I consulted through the GD library and it really was disabled.
What I did was on Windows, on Linux I added below:
IN WINDOWS
I got into my php.ini
and edited the line containing the GD2 extension:

After this restart the server (Apache, Nginx, php -S)
LINUX
On Linux just install the library with the dependency manager:
yum install php-gd # CentOS
apt-get install php7-gd # Ubuntu
After this restart the service (Apache, Nginx, php -S)
Then just to check, I entered again in info.php and really was enabled and worked my function:

This function is part of the GD library, it should not be installed. Check your php info.
– bfavaretto