ImageMagick

Redirect STDERR output from COM object wrapper in .NET

与世无争的帅哥 提交于 2020-01-03 11:44:12
问题 I'm trying to make use of the ImageMagick COM object (ImageMagickObject) in a .NET library. This library is intended to be called from IronRuby, but that isn't all that important. I want to take this approach because it will fit with my existing calls, which currently call the ImageMagick binaries as external processes. The COM object will take the same arguments as the binaries, but will save the process creation and are about 5x faster overall. My only hurdle is that the "Compare" method

PHP script to convert multiple images into a video with imagick

纵饮孤独 提交于 2020-01-03 05:45:08
问题 I found this command line that uses ImageMagick to convert images into a video: ImageMagick convert -delay 100 -quality 75 1.jpg 2.jpg movie.mpg Is there a way to do this in php with imagick? I am trying to find a way to do this on a website. My google-fu has failed me and I appreciate any help :) 回答1: Considering that convert is the executable program you're using from the command-line, the simplest solution would be to use it from your PHP scripts ;-) About that, you'll want to read through

ImageMagick.net issues

北慕城南 提交于 2020-01-03 05:09:26
问题 I am using ImageMagick.net and I have added ImageMagickNET.dl reference to my project. This is the code is I am using. MagickNet.Magick.Init(); MagicNet.Image img = new MagicNet.Image("file.jpg"); img.Resize(System.Drawing.Size(100,100)); img.Write("newFile.png"); MagickNet.Magick.Term(); But I am getting this error "'ImageMagickNET.MagickNet' does not contain a definition for 'Magick'" 回答1: oups, try this I test it it works: using System; using M = MagickNet; using System.Drawing; namespace

How can I create a specific number of thumbnails from a PDF using Imagick, ImageMagick, and PHP?

落爺英雄遲暮 提交于 2020-01-03 04:51:06
问题 I'd like to use PHP, ImageMagick, and Imagick ( PHP Class ) to create thumbnails of a PDF. Some PDFs will only have one page, and some will have many. I'd like to specify a number ( N ) of thumbnails to create, one for each of the first N pages in the PDF. The code below works, but produces errors when the PDF doesn't have enough pages ( because I'm trying to instantiate Imagick on a PDF page that doesn't exist ). I also know that ImageMagick can create thumbnails for all the pages in a PDF

“-type truecolorAlpha” does not work

风格不统一 提交于 2020-01-03 03:38:12
问题 I have some images whose type is PaletteAlpha and which have to be TrueColorAlpha . I am trying to use the command convert testein -type TrueColorAlpha testeou to do this conversion but the result is an image which still has Type: PaletteAlpha . Is this behaviour expected? How can I transform from one type to the other? I have also tried things such as PNG:testeou but with no results. My IM version is 6.7.8-9 . 回答1: The PNG32: prefix forces the output PNG to be RGBA: convert logo:

Can You Get a Transparent Gradient using PHP ImageMagick?

你。 提交于 2020-01-03 03:14:25
问题 Something to the tune of: $gradient->newPseudoImage($width, $height, "gradient:transparent-transparent"); Basically I'm looking to create a wet floor effect for uploaded images. So far, it seems you can only create a gradient into a solid color. 回答1: It turns out if the image you are cloning does not have an alpha channel set you can't create a gradient from an image to a transparent background (at least, I was unable to find a way) What you can do is test for the alpha channel and set it if

Setting an alpha channel when constructing an ImagickPixel

拈花ヽ惹草 提交于 2020-01-02 18:33:07
问题 I am new to using ImageMagick. I am using the latest imagick extension (3.1.0rc1) with PHP. However, the documentation for imagick seems to be somewhat sparse. I want to create an ImagickPixel object with an alpha channel. The documentation states that these are some valid color values to pass to the constructor: "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc . I know that it is possible to retrive the alpha value of an ImagickPixel using getColorValue(imagick::COLOR_ALPHA); .

Can't install GhostScript in ImageMagick

随声附和 提交于 2020-01-02 10:04:43
问题 Download latest version of ImageMagick. Unpacked it. Installing Ghostscript like this: $ sudo apt-get install ghostscript After that try to configure ImageMagick: $ ./configure --with-gslib $ make $ make install After that i try to conver PDF to jpg $ sudo /usr/local/bin/convert in.pdf out.jpg And i see this mistake convert: no decode delegate for this image format `/tmp/magick-BzHdr4Kp-00000001' @ error/constitute.c/ReadImage/544. convert: Postscript delegate failed `in.PDF': Нет такого

Imagick (Imagemagick on PHP): serve a file without saving to disk first?

空扰寡人 提交于 2020-01-02 09:20:08
问题 I'm trying to use Imagemagick (actually PHP's Imagick) to create and output (serve) an image without saving it to disk first. Currently I'm having to save the file and then use verot upload class to serve the image. (Apache 2 server, PHP5) 回答1: Sure. This should work for you: $image = new Imagick(); // Do your image creation stuff. Make sure to set $image->setImageFormat(); header('Content-Type: image/filetype'); // Change filetype echo $image; 回答2: I admit to never having used Imagick, but

Convert Magick::Image to cv::Mat

为君一笑 提交于 2020-01-02 08:21:28
问题 I am trying to convert an image loaded in from a GIF via Magick++ into a cv::Mat . I have already converted from cv::Mat to Magick::Image but cannot seem to find how to pull the data out of an Image in Magick in order to load it into a Mat. What's the best way to do this? For reference, in reverse: Convert cv::Mat to Magick::Image 回答1: Updated Answer This is the best I can get it, I think! #include <opencv2/opencv.hpp> #include <Magick++.h> #include <iostream> using namespace std; using