ImageMagick

python wand.image is not recognized

╄→尐↘猪︶ㄣ 提交于 2019-12-18 12:58:16
问题 I installed Imagemagic (both 32 and 64 bits versions were tried) and then used pip to install wand, I also set the Magick_Home env. variable to imagemagic address but when I run Traceback (most recent call last): File "<stdin>", line 1, in <module> File "c:\Anaconda2\lib\site-packages\wand\image.py", line 20, in <module> from .api import MagickPixelPacket, libc, libmagick, library File "c:\Anaconda2\lib\site-packages\wand\api.py", line 205, in <module> 'Try to install:\n ' + msg) ImportError:

how to resize an SVG with Imagick/ImageMagick

会有一股神秘感。 提交于 2019-12-18 11:53:41
问题 I am sending a string representation of an SVG file to the server and using Imagick to turn this into a jpeg in the following manner: $image = stripslashes($_POST['json']); $filename = $_POST['filename']; $unique = time(); $im = new Imagick(); $im->readImageBlob($image); $im->setImageFormat("jpeg"); $im->writeImage('../photos/' . $type . '/humourised_' . $unique . $filename); $im->clear(); $im->destroy(); However I wish to resize the SVG prior to rasterizing it so the the resulting image is

ImageMagick: how to minimally crop an image to a certain aspect ratio?

痞子三分冷 提交于 2019-12-18 11:44:45
问题 With imagemagick, I'd like to crop an image, in a minimal fashion, so that it fits a given aspect ratio. Example: given an image of, say, 3038 x 2014 px, I want to crop it to have a 3:2 aspect ratio. The resulting image would then be 3021 x 2014 px, cropped from the, say, center of the original image. So looking for a command looking something like convert in.jpg -gravity center -crop_to_aspect_ratio 3:2 out.jpg . 回答1: 1. Specific target resolution If your goal at the end is to have a certain

Converting a multi page pdf to multiple pages using a single command

筅森魡賤 提交于 2019-12-18 11:42:19
问题 I want to convert multi page pdfs into single page images efficiently. I already know how to do this one page at a time with imagemagick. For example, convert x.pdf[2] x3.jpg will give me the 3rd page of the pdf as an image. So if I figure out how many pages are in the pdf using identify then I can loop through and convert all pages in the pdf to images. This method can however take a while. For example a 15 page pdf could take anywhere between 15-30 seconds. According to answers that I have

Efficiently generating thumbnails with ImageMagick and convert

◇◆丶佛笑我妖孽 提交于 2019-12-18 10:56:07
问题 I'm looking to efficiently generate various sized thumbnails with ImageMagick's convert utility in Python. Some of my image files are quite large (~15MB JPGs). One way I could do it would be to take the full-sized image, and to generate the various thumbnails from the full-sized image, as follows: convert sample_image.jpg -resize 1024x768 sample_image-1024x768.jpg convert sample_image.jpg -resize 800x600 sample_image-800x600.jpg convert sample_image.jpg -resize 400x300 sample_image-400x300

Efficiently generating thumbnails with ImageMagick and convert

守給你的承諾、 提交于 2019-12-18 10:56:03
问题 I'm looking to efficiently generate various sized thumbnails with ImageMagick's convert utility in Python. Some of my image files are quite large (~15MB JPGs). One way I could do it would be to take the full-sized image, and to generate the various thumbnails from the full-sized image, as follows: convert sample_image.jpg -resize 1024x768 sample_image-1024x768.jpg convert sample_image.jpg -resize 800x600 sample_image-800x600.jpg convert sample_image.jpg -resize 400x300 sample_image-400x300

PDF to JPG conversion using PHP

早过忘川 提交于 2019-12-18 10:50:59
问题 I'm trying to convert PDF to IMG (JPG) with help PHP. I'm using imagick extension. this is my code $fp_pdf = fopen($pdf, 'rb'); $img = new imagick(); // [0] can be used to set page number $img->readImageFile($fp_pdf); $img->setImageFormat( "jpg" ); $img->setImageCompression(imagick::COMPRESSION_JPEG); $img->setImageCompressionQuality(90); $img->setResolution(300,300); $img->setImageUnits(imagick::RESOLUTION_PIXELSPERINCH); $data = $img->getImageBlob(); my source pdf file has right dimension

RMagick complains it was configured with a different version of ImageMagick

非 Y 不嫁゛ 提交于 2019-12-18 10:39:16
问题 I am getting following error while running local script/server of my Rails project: This installation of RMagick was configured with ImageMagick 6.6.1 but ImageMagick 6.4.5 is in use. (RuntimeError) Running identify --version shows the following: Version: ImageMagick 6.6.1-10 2010-05-21 Q8 http://www.imagemagick.org So, my question is how and where should I make changes to work it fine; I have already reinstalled ImageMagick but that didn't work. 回答1: the same thing happened to me but the

ImageMagick module not available with this PHP installation on Laravel 5.4 with PHP 7

岁酱吖の 提交于 2019-12-18 06:48:54
问题 Currently, I have cloned a project. I have PHP 7 on Ubuntu 14.04 64-bit. The ImageMagick library is installed using the following command sudo apt-get install php-imagick But when I try image manipulation through this library, it throws the following exception (1/1) NotSupportedException ImageMagick module not available with this PHP installation. How can I install this software with the latest PHP version? Note: I am using Laravel 5.4 in this project. 回答1: You have to add extension=imagick

iPhone ImageMagick Library - converting from batch file script to Objective-C using MagickWand API

一笑奈何 提交于 2019-12-18 05:29:07
问题 I've decided to use the following ImageMagick library for iPhone development: https://github.com/marforic/imagemagick_lib_iphone It works quite well. The sample project compiles just fine, but doesn't make any sense whatsoever. Usually, I'll use the " convert.exe " that comes with ImageMagick for Windows to convert images via the command line. So I'll write a little batch file like the following: @echo off set SOURCE=image_to_convert.jpg del result.jpg del source_copy.jpg convert.exe %SOURCE%