I'm using ubuntu and have installed ImageMagick

```
identify -version

```

gives:

```
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

```

I tried:

```
exec('magick img.jpg ( -clone 0 -fill white -colorize 100 ) ( -clone 0 -color-threshold "gray(251)-gray(254)" ) -compose over -composite -quality 80% result.jpg', $output, $return_var);
echo '<pre>' , var_dump($output) , '</pre>';

```

also `convert` and `magick convert` instead of `magick`

then according to [this](https://askubuntu.com/questions/1127260/imagemagick-convert-not-allowed) answer I opened `/etc/ImageMagick-6/policy.xml`

and changed `<policy domain="coder" rights="none" pattern="PDF" />` to `<policy domain="coder" rights="read|write" pattern="PDF" />`

but still doesn't work and `$output` always returns empty array

PS: I don't want to use the PHP extension, already did and it has some flaws