ImageMagick

Image processing class in PHP

旧城冷巷雨未停 提交于 2019-12-13 04:43:35
问题 I need to build a PHP photo processing class, I know there are MANY that already exist to the public but I need to build one to do just what I need done and nothing extra and nothing less. I need my class to do this... 1) I create a new instance of my class and I pass in either a URL of a photo, or the path to a local photo being uploaded using POST form. 2) I then need to take the main image and check it's dimensions, if it is wider the 800 pixels, I need to resize it down, if it is not

You must provide a value expression following the '%' operator

允我心安 提交于 2019-12-13 04:32:51
问题 PS C:\ImageMagick> convert -background transparent -fill hsb(0%,0%,0%) -font Arial -pointsize 18 -size 18x26 -gravity center label:p "output2.png" At line:1 char:51 + convert -background transparent -fill hsb(0%,0%,0%) -font Arial -pointsize 18 -s ... + ~ You must provide a value expression following the '%' operator. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : ExpectedValueExpression The command above which works without any trouble in a

Imagick Equivalent Of This Imagemagick Command?

房东的猫 提交于 2019-12-13 04:26:59
问题 I'm trying to create a vignette effect, and I can get desired result through command line. But when I try it with Imagick, I'm not getting the desired result convert i.jpg ( -size 150x150 radial-gradient:black-white -gravity center -crop 100x100+0+0 +repage ) -compose multiply -flatten o.jpg I tried the following Imagick commands $gra = new Imagick(); $gra->newPseudoImage(150, 150, "radial-gradient:black-white"); $gra->cropThumbnailImage(100, 100); $gra->setImagePage(100, 100, 0, 0); $img =

Error Installing PythonMagick Under OSX Lion

ぃ、小莉子 提交于 2019-12-13 04:23:39
问题 Has anyone here on StackOverflow been able to get PythonMagick successfully installed on a Mac computer running Lion? I've downloaded the PythonMagick source and installed all of the dependencies specified. However, when I run "./configure", "make" and "make install" it exits with an "error 1". Any help would be greatly appreciated. thank you, L. 回答1: To answer your question: yes, people have been able to get PythonMagick to work. You'll need to include more information about the error for us

Paperclip custom processor not changing image type

半城伤御伤魂 提交于 2019-12-13 04:22:12
问题 I'm having a few problems with a paperclip custom processor. At the command line this line : $ convert cats.jpg -thumbnail 300x400 -bordercolor white -background black +polaroid cats.png Successfully converts this : https://dl.dropboxusercontent.com/u/4233433/cats.jpg Into this : https://dl.dropboxusercontent.com/u/4233433/cats.png i.e a JPEG converted into a PNG with a transparent background. Which is exactly what I am trying to achieve. However when I attempt to do this within Rails (4.0.1)

use Python to call ImageMagick's “import”

假装没事ソ 提交于 2019-12-13 04:07:12
问题 I want to capture a screenshot of an application's window from a Python script using ImageMagick, as I would with ImageMagick's "import" command from a shell. An API call or a system call from Python (as in "subprocess.Popen(["import"...") will suffice, but I don't want to create a file on the hard drive. My OS is Linux. 回答1: Execute the command: import png:- This will cause import to output to stdout. You can also change png to one of the type tags shown here. 来源: https://stackoverflow.com

Powershell with Image Magick Montage reading from text file

为君一笑 提交于 2019-12-13 03:48:40
问题 I am working on a PowerShell script using Image Magick's montage function. My script works until the source files (.jpgs) volume increases to an ambiguous number of files. Once there are 'too many' files, the script fails due to 'Program 'montage.exe' failed to run: The filename or extension is too long' . It was suggested on the Image Magick forum (link @ bottom) to have PowerShell read from a text doc instead to reduce the length using the '@' operator. The code now looks like: montage

imagemagick error when run from bash script on Mac OSX

北城以北 提交于 2019-12-13 03:36:17
问题 I want to run the following script in bash 3.2.57(1): #!/bin/bash basename=abc convert $basename.pdf $basename.png I get the following error: dyld: Library not loaded: /ImageMagick-7.0.8/lib/libMagickCore-7.Q16HDRI.6.dylib Referenced from: /Users/XXX/Applications/ImageMagick-7.0.8/bin/convert Reason: image not found ./batch_convert.sh: line 22: 46228 Abort trap: 6 convert $basename.pdf $basename.png When I run the same 2 commands (setting the variable and convert ), I get no error. Why is

Montage / Join 2 TIFF images in a 2 col x 1 row tile without losing quality

倖福魔咒の 提交于 2019-12-13 03:22:26
问题 I have 2 same size, dimensions, and resolution images in TIFF (6400x6400 pixels, 800x800 ppi). The files are 18.7MB and 27.0MB, they were created with R's tiff() with compression="lzw" . When I try to create a tile using montage -compress lzw -tile 2x1 -geometry +0+0 Figure4L.tiff Figure4R.tiff Figure4.tiff I get a file 12800x6400 TIFF which has a size of 12.8 MB, GIMP reports a resolution of 72 x 72 ppi. GIMP also reports "Warning:The image you are loading has 16 bits per channel. GIMP can

PHP Imagick don't use custom font > convert does

孤街浪徒 提交于 2019-12-13 03:18:15
问题 It's driving me insane.. Just searched for hours to find a solution. But nothing really found. So hopefully anyone can help me. I'm trying to create an customized image on the fly. I use this to create the images: https://github.com/Treinetic/ImageArtist Everything works fine except the font. This is the snippet from the class: $im = new \Imagick(); $background = new \ImagickPixel('none'); $im->setBackgroundColor($background); $im->setFont($font->getPath()); $im->setPointSize($writer->getSize