The `COLOR_OPACITY` doesn't exist if you are using ImageMagick lib 7 or newer version!
Here is the c source code:
#if MagickLibVersion < 0x700
IMAGICK_REGISTER_CONST_LONG("COLOR_OPACITY", PHP_IMAGICK_COLOR_OPACITY);
#endif
There isn't any information about it anywhere (or I didn't find it)! So, if you want to use it, use the 6 version of lib! You can see the current installed version of lib with this command:
$ identify -version