ImageMagick

How do I batch resize all images to sqares with Image Magick?

主宰稳场 提交于 2020-01-16 13:10:11
问题 OK. I have a horizontal image, let's say 2000 x 300. I want to overwrite that image and create a new one that is 2000 x 2000 with the old image center in the middle and vertically, with white space around it. I also want to do this in batch with many different images of different sizes. Thanks in advance. 回答1: Use -resize to resize the image to 2000x2000, -background to set the background to white, -gravity to center the original image on the canvas, and -extent to resize the canvas itself

Converting PDF to PNG for Tesseract to process

与世无争的帅哥 提交于 2020-01-16 05:21:05
问题 I'm having an issue at the moment with Imagemagick and Tesseract. I'm working on a command-line classifier for documents in PHP. The idea is that it takes in PDF documents and uses the League Pipeline package to pass it through numerous steps. The steps I've identified as necessary are as follows: Convert PDF to a PNG file Extract text from PNG file Run text through a machine learning library to classify it The main command for that looks like this: <?php namespace Matthewbdaly

Image manipulation using Node.js on Azure website

左心房为你撑大大i 提交于 2020-01-16 04:53:20
问题 I'm developing a web project using Node.js where users can set their profile image by uploading it to the server. I need to perform basic manipulation on those images (resize and crop), and then store them into a blob. I usually use GraphicsMagic or ImageMagick to achieve this kind of tasks, but I want to publish this project on Microsoft Azure website. Is there a known and safe way to manipulate images serverside into an Azure website using Node.js? 回答1: You can use node modules with Azure

imagemagick: append a label under image with font size

六月ゝ 毕业季﹏ 提交于 2020-01-16 01:06:30
问题 How to append a label under an image with a font size? convert image.png -label "Test label" -pointsize 100 -gravity center -append image.png 回答1: Like this: convert image.png -pointsize 36 label:"Test label" -gravity center -append result.png When you use xc: , label: , pattern: and gradient: (i.e. all the ones with no dash at the start and a colon at the end), ImageMagick creates a canvas for you to put the data on. 来源: https://stackoverflow.com/questions/33942892/imagemagick-append-a-label

Class imagick not found when ran from CLI

好久不见. 提交于 2020-01-15 11:54:49
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Class imagick not found when ran from CLI

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 11:54:37
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Class imagick not found when ran from CLI

南楼画角 提交于 2020-01-15 11:54:09
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Class imagick not found when ran from CLI

余生颓废 提交于 2020-01-15 11:54:08
问题 $im = new imagick($file); This line of code will work fine when ran from my browser, but when I try to run it from command line (CLI) then I get the following error... Class 'imagick' not found Any ideas why it won't work from CLI? 回答1: Found a solution: sudo aptitude install make php5-dev php-pear sudo aptitude remove php5-imagick sudo aptitude install libmagick9-dev sudo pecl install imagick sudo /etc/init.d/apache2 restart http://kvz.io/blog/2008/02/27/class-imagick-not-found/ 回答2: The php

Imagemagick compose image inverted

前提是你 提交于 2020-01-15 10:35:44
问题 I want to watermark an image, so I used compose multiply, but for some reason it doesn't work as expected. The command: magick image.jpg over.png -compose multiply -resize 2048x2048 -gravity center -quality 65 -strip -composite out.jpg The over.png get inverted first and then applied?? If use the same command with and older version of Imagemagick (x32 6.7.6-1 2012-03-17 Q16) I get the expected results. This was tested with x64 ImageMagick 7.0.5 Q16 under Windows 10. Ah it seems I can't post

ImageMagick PATH not being recognized with engine = “tikz” in knitr

做~自己de王妃 提交于 2020-01-15 06:14:27
问题 I am trying to compile TikZ graphics from knitr . I am using the example available here. I am specifically trying to knit from Rstudio. The output I get from the "R Markdown" tab is as follows: processing file: test.Rmd Invalid Parameter - /test_files Quitting from lines 16-31 (test.Rmd) Error in (knit_engines$get(options$engine))(options) : problems with `convert`; probably not installed? Calls: <Anonymous> ... process_group.block -> call_block -> block_exec -> in_dir -> <Anonymous>