Category : imagick

I use PHP and Imagick extension for resize a photo (about 5000×7000): $img = new Imagick($fn); $img->thumbnailImage($width, 0); It works for $width is 800, 900 … 1300, but it crashes for 1400 and 1600: cache resources exhausted /app/photo.jpg’ @ error/cache.c/OpenPixelCache/4083. I assumed it depends on the width and the result image size. And googling for ..

Read more

So i want to convert existing images in my project from jpeg/jpg/png to .webp extensions. I have read that using imagine for it https://github.com/liip/LiipImagineBundle/pull/1307, but it doesn’t work, my liip_imagine looks like this: liip_imagine: driver: "imagick" default_filter_set_settings: format: webp webp: generate: true quality: 80 cache: ~ data_loader: ~ post_processors: [ ] resolvers: profile_photos: web_path: # ..

Read more

Below is the Imagick code reading a PDF file. $imgExtension = new Imagick(); $imgExtension->setResolution(300,300); $imgExtension->readImage($pdffile); Below error appears in the log-> production.ERROR: attempt to perform an operation not allowed by the security policy `PDF’ @ error/constitute.c/IsCoderAuthorized/408 {"userI d":1,"exception":"[object] (ImagickException(code: 499): attempt to perform an operation not allowed by the security policy `PDF’ @ error/constitute.c/IsCoderAutho rized/408 ..

Read more

The image not having the text rendered $image = new Imagick(); $image->readImage(dirname(__FILE__) . "/images/base.jpg"); $font = dirname(__FILE__) . "/fonts/Raleway-Regular.ttf"; $fs= 70; $col = "Black"; $bg = "White"; $conts = "hello worl"; $format = "jpg"; $w = $image->getImageWidth(); $h = $image->getImageWidth(); $txt = new ImagickDraw(); $txt->setFillColor(new ImagickPixel($col)); $txt->setFontSize($fs); $txt->setFont($font); $txt->setTextAlignment(Imagick::ALIGN_CENTER); $txt->annotation($w/2, $h/2, $conts); $dst = dirname(__FILE__) ..

Read more

I am running the following code: $img = new Imagick($path); $bgColour = $img->getImagePixelColor(0, 0); $bgColourRGB = $bgColour->getColor(); // analysing the same png image sometimes // the alpha (a) value is 1 and sometimes 0 /* array:4 [ "r" => 85 "g" => 85 "b" => 85 "a" => 1 ] */ dd($bgColourRGB); In GIMP, there ..

Read more

I am trying to get dominant colors from image with percentage or with count of each color. I tried this method from imagick php library. $imagick->quantizeImage(256, Imagick::COLORSPACE_YIQ, 0, false, false); $imagick->uniqueImageColors(); $imagick->scaleimage($imagick->getImageWidth(), $imagick->getImageHeight() * 20); header("Content-Type: image/png"); echo $imagick->getImageBlob(); It is returning the image blod but i want color value in hex or rgba with ..

Read more

When I try to run the following command pecl install imagick Then the installation end up with: imagemagick/7.0.11-9/lib -L/usr/local/Cellar/imagemagick/7.0.11-9/lib -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/imagick.so -bundle .libs/imagick_file.o .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick.o .libs/imagickkernel_class.o .libs/shim_im6_to_im7.o -lgomp -L/usr/local/Cellar/imagemagick/7.0.11-9/lib /usr/local/Cellar/imagemagick/7.0.11-9/lib/libMagickWand-7.Q16HDRI.dylib -L/usr/local/Cellar/little-cms2/2.12/lib -L/usr/local/opt/freetype/lib -L/usr/local/Cellar/glib/2.68.1/lib -L/usr/local/opt/gettext/lib /usr/local/Cellar/imagemagick/7.0.11-9/lib/libMagickCore-7.Q16HDRI.dylib -Wl,-rpath -Wl,/usr/local/Cellar/imagemagick/7.0.11-9/lib ld: library not found for -lgomp clang: error: ..

Read more