ImageMagick

Specify default substitution font when converting pdf to image using imagemagick and font is missing

痴心易碎 提交于 2019-12-24 12:11:51
问题 I am using Spatie/pdfToImage that builds on ghost script and imagemagick to on my server: Take a multiple page pdf from an email using mailgun routing. Save the pdf in folder /docs_pdf like file.pdf Use a foreach to loop through each page and save each page as a png to /docs like file_#.png locally where I use laravel -> valet everything works fine. On my server using digital ocean through laravel forge the language in a multipaged pdf that is in swedish transforms from normal swedish to a

Image Magick++ equivalent to convert -fill

孤人 提交于 2019-12-24 11:51:14
问题 I have a convert command that I need to translate into Image Magick function calls. convert.exe bar.jpg -fuzz 40% -fill "rgb(53456, 35209, 30583)" -opaque "rgb(65535, 65535, 65535)" foo2.jpg I was wondering if anyone could give me an example of the methods I need to apply to get the same effect? Thanks for any help! 回答1: The documentation for Magick++ is pretty clear, but there's a lot more examples using c & MagickWand. For the most part, -fill is just setting a color attribute that can be

Base64 jpg to base64 Png in Ruby

与世无争的帅哥 提交于 2019-12-24 11:37:33
问题 I'm working with base64 files and i would like to convert a base64jpg image in a base64png image. Is there a way to do it? The reason is i'm using rsvg-convert to convert svg files into png files, but when i have a base64jpg in my svg, it's not working, But it works with base64 files. 回答1: In ImageMagick, this works for me. Create JPG base 64 file: convert rose: rose.jpg convert rose.jpg inline:rose_base64jpg The text file rose_base64jpg shows: data:image/jpeg;base64,/9j

How do I add a package to an already existing image?

ぐ巨炮叔叔 提交于 2019-12-24 10:52:34
问题 I have a RoR app that uses imagemagick specified in the Gemfile. I am using Docker's official rails image to build my image with the following Dockerfile: FROM rails:onbuild RUN apt-get install imagemagick and get the following error: Cant install RMagick 2.13.2. Cant find Magick-config in /usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Now, that's probably because the imagemagic package is missing on the OS, even though I specified it in my Dockerfile. So I

Difference running python in PyCharm and in terminal

喜你入骨 提交于 2019-12-24 10:39:21
问题 I'm wondering what is the difference when I run a python program from PyCharm or from the command line. Actually I'm using a library called wand-py (ImageMagick binding). If I run my program from the command line it works. Though if I use PyCharm Run or debug it doesn't and I get the following traceback. /Users/alexisbenoist/Documents/python/papyrus/env/bin/python "/Applications/PyCharm CE.app/helpers/pydev/pydevd.py" --multiproc --client 127.0.0.1 --port 58993 --file /Users/alexisbenoist

PHP: Need to convert imagemagick command to php script

雨燕双飞 提交于 2019-12-24 10:36:23
问题 I use this command to batch modify images for a site. They need to be this size to suit the theme. Now I also want to use these images in Facebook Ads, but they have to be resized. The command I use (which works fine) is: for i in `ls -1 *.jpg`; do convert $i -fuzz 10% -trim +repage -resize 980x1200 -background white -gravity center -extent 980x1200 $i; done Now I need to make a PHP script that does the same, but also returns the image as response. I came up with the following: <?php /*

imagemagick with grayscale not working

心不动则不痛 提交于 2019-12-24 09:28:58
问题 I am trying to change a file named "anvil_base.png" to grayscale so I am using imagemagick. What I am entering is convert anvil_base.png -colorspace Gray -gamma 2.2 anvil_base.png but it is just returning this Invalid Parameter - -colorspace What am I doing wrong? 回答1: I suspect you are on Windows and you have not put the directory where ImageMagick is installed ahead of other directories in your PATH. You have three choices: Option 1 As Glenn kindly points out, if you are using ImageMagick

How to remove background of images with the magick package?

瘦欲@ 提交于 2019-12-24 08:35:34
问题 Is it possible to remove the background of images with the magick package? I know how to use edge detection with Gimp/Inkscape to crop out silhouettes; however, I'm looking to automate the process for a large batch of images with R . My ultimate goal is to use the ggimage package to plot these images as x,y coordinates but the background of these images is currently overlapping the plot (the dog compared to fink) library("ggplot2") library("ggimage") set.seed(2017-02-21) d <- data.frame(x =

Installation of imagemagick with BREW

試著忘記壹切 提交于 2019-12-24 08:16:11
问题 My problem is really simple :) schovi@Saskia:~/tmp $ brew install imagemagick Error: You must install brew install git schovi@Saskia:~/tmp $ brew install git Warning: Formula already installed: git schovi@Saskia:~/tmp $ brew install imagemagick Error: You must install Git: brew install git Any idea? :) 回答1: Install git from http://git-scm.com/ 来源: https://stackoverflow.com/questions/6417135/installation-of-imagemagick-with-brew

Rails can't find image_magick gem

夙愿已清 提交于 2019-12-24 07:24:07
问题 I am trying to use image_magick gem to process image uploads, but rails can't locate it. I have installed the gem successfully using: gem install mini_magick-1.2.3.gem --local gem update system gem cleanup and my model has require 'rubygems' require 'mini_magick' However, I still get the error: no such file to load -- mini_magick Can I add something to the environment.rb to point rails to the correct location? Environment information: Windows XP/InstantRails 2.0 ruby 1.8.6 (2007-09-24