ImageMagick

Imagemagick command geometry not working

点点圈 提交于 2019-12-24 19:23:26
问题 I am having image1.jpg with the size of 350x500 and another image2.png ( 350x150 ) with gradient effects like shadow. I need to apply the shadow to image1.jpg in its bottom. But geometry doesn't work for me. convert -extent 600x700\! image1.jpg \( image2.png -geometry +0+500 \) -composite final.png I hope the geometry will position an image at the point I have given, If I am right, geometry is not working for me. 回答1: Not certain what you are trying to achieve, but is this close: convert xc

How to undo or remove the drawn rectangle using Convert?

安稳与你 提交于 2019-12-24 18:35:55
问题 I have used convert this to draw a rectangle on image now i want to undo this the how? help? convert Image1.jpg -fill black -draw "rectangle 135,55 155,60" Image2.jpg 回答1: Once you draw a rectangle onto an image, it has replace the pixels in the image with the color of rectangle. You cannot undo that. You can replace the color of the rectangle with some interpretation of the image pixels nearby using morphology techniques in Imagemagick by making a mask from the same rectangle and using that

Imagemagick convert pdf to png

和自甴很熟 提交于 2019-12-24 17:08:20
问题 I am rather new to using the command line and php. That being said I have been trying to figure out how to use ImageMagick with the exec() function. I have this currently, $command="/usr/local/lib/ImageMagick convert images/a.pdf images/a.png"; if(exec($command)){ echo 'yes'; } else{ echo 'no'; } Which is returning 'no'. I believe I am missing something about how to execute convert from the correct directory. Is my $command set up properly? (I was given the path to ImageMagick from my web

How to calculate the rotation angle for an overlying image, so that it just fits diagonally iniside an underlying image?

北城以北 提交于 2019-12-24 16:17:48
问题 I'd like to place a watermark diagonally over a number of pictures. The width and length of these pictures differ and some might even be smaller than the watermark itself. This will be used inside a script, in which the user can choose from different options like "horizontal", "vertical", "diagonal" or specify an angle by himself/herself. Therefore I need to calculate the rotation angle. The angle should rotate the watermark, so that it is diagonally positioned over the underlying image.

How to rotate a composite image with fixed center?

我怕爱的太早我们不能终老 提交于 2019-12-24 14:29:50
问题 So, I have this background image: And I have a 1px x 1px image that I want to overlay on that. If I run: convert bg.png \( -size 80x240 -background none -rotate 30 -geometry +120+88 tile:red.png \) -composite result.png I get this: But I want to rotate it with fixed center. The expected result should be something like this: Do you know how can I accomplish that? Thank you. 回答1: Looking into the comment by @frostyterrier I think his problem is he needs +distort and is using -distort? This page

Set a Document Name when creating a PDF from an Image

对着背影说爱祢 提交于 2019-12-24 14:04:14
问题 I'm using the following code to create a pdf from a jpg image: $im = new Imagick(); $im->readImage('./image.jpg'); $im->setImageFormat('pdf'); $im->writeImage('../images/pdf/image.pdf'); Now I recently Saw that google indexed the image.pdf file but as the title on the google search page it says "Untitled" instead of "Image" cause the name was image.pdf. So to me it appears as if PDF had it's own naming which has been left out in my code. How can I change that "Untitled" to the actual title

ImageMagick: Watermark image and keep file name

大憨熊 提交于 2019-12-24 13:55:05
问题 I have this code but I would like to edit it so the exported file name is the same as the file name used to make it mogrify -composite -gravity center ~/Desktop/civmap-client-master/data/watermark.png ~/Desktop/civmap-client-master/data/nowm/*.png ~/Desktop/civmap-client-master/data/wm/*.png It just throws an error when I used *.png as my exported file name. Please note I have multiple files in the /nowm/ directory. I am using a Mac. Thanks alot :) 回答1: The mogrify command does not accept

Image Paperclip::Errors::NotIdentifiedByImageMagickError #Windows

╄→гoц情女王★ 提交于 2019-12-24 13:44:18
问题 I'm getting tired of this error... I tried everything that's on the internet (that I found so far) Gem gem 'paperclip', '~> 4.3', '>= 4.3.6' config/environments/development.rb Paperclip.options[:command_path] = "/c/Program Files/ImageMagick-7.0.1-Q16/" Paperclip.options[:command_path] = 'C:\Program Files (x86)\GnuWin32\bin' path for ImageMagick/convert https://gyazo.com/2e8714546606b796b63f5b64663cab31 file.exe it installed https://gyazo.com/5d0d3d5723c52e6cc812d72202ba4038 my model has

Imagemagick unwanted black background on rotated transparent images

江枫思渺然 提交于 2019-12-24 13:43:11
问题 I have a website that generates polaroid-like images stacked on eachother at different angles. Up until now everything worked well, but now i've started getting some black background around my transparent .png's. You can see the problem here. The images in the last album are all messed up. I'm using imagemagick (6.5.4.7-3.fc12). my commands look something like this: the first one is contained whitin a foreach and generates a bunch of pngs rotated at different angles convert '{$sf}' -auto

ImageMagick & Pie Charts

谁说我不能喝 提交于 2019-12-24 12:15:14
问题 What is the most direct way to draw a pie chart using ImageMagick in an existing image. For example, how would I draw a single slice given the following inputs? A center point (x,y) Radius Percent 回答1: Create your pie wedge using SVG; I got my example from here: <svg> <path d="M200,200 L200,20 A180,180 0 0,1 377,231 z" style="fill:#ff0000; fill-opacity: 1; stroke:black; stroke-width: 1"/> </svg> Then, overlay that image using ImageMagick to your background image. composite.exe -background