ImageMagick

graphicsmagick is doubling the size of “some” PNG files

不问归期 提交于 2019-12-24 07:05:19
问题 Using GraphicsMagick to read in a PNG file and write it out under a different name is causing the file size to increase by more than double. This only happens to some PNG files and I can't figure out what is causing it. Example problem PNG: http://www.google.co.in/logos/2011/verne-hp-3.png I have tried everything from disabling the opacity channel to using different compression types to changing the interlacing type but nothing is helping me understand what is causing this problem. If anyone

Adding watermark to video

有些话、适合烂在心里 提交于 2019-12-24 03:22:32
问题 I am able to use the moviepy library to add a watermark to a section of video. However when I do this it is taking the watermarked segment, and creating a new file with it. I am trying to figure out if it is possible to simply splice in the edited part back into the original video, as moviepy is EXTREMELY slow writing to the disk, so the smaller the segment the better. I was thinking maybe using shutil? video = mp.VideoFileClip("C:\\Users\\admin\\Desktop\\Test\\demovideo.mp4").subclip(10,20)

Adding watermark to video

喜你入骨 提交于 2019-12-24 03:21:04
问题 I am able to use the moviepy library to add a watermark to a section of video. However when I do this it is taking the watermarked segment, and creating a new file with it. I am trying to figure out if it is possible to simply splice in the edited part back into the original video, as moviepy is EXTREMELY slow writing to the disk, so the smaller the segment the better. I was thinking maybe using shutil? video = mp.VideoFileClip("C:\\Users\\admin\\Desktop\\Test\\demovideo.mp4").subclip(10,20)

Reduce image size imagemagic

≯℡__Kan透↙ 提交于 2019-12-24 00:12:04
问题 I have tried to compress image but has no success. Look at my small experiment var results = new Dictionary<int, int>(); for (int i = 0; i <= 100; i++) { var stream = new MemoryStream(); image.Quality = i; image.CompressionMethod = CompressionMethod.Zip; image.Write(stream, MagickFormat.Png); results[i] = stream.GetBuffer().Length; stream.Flush(); } var best = results.OrderBy(e => e.Value).First(); // the same length as for original image. quality doesn't work in this example - dictionary

Undefined method has_attached_file after Paperclip installation?

拜拜、爱过 提交于 2019-12-23 19:34:09
问题 Not sure if I've done everything right here. I added the Paperclip gem to my Gemfile and did bundle install. I followed along with the readme instructions on Paperclips Github page. I wasn't sure if I needed to install ImageMagick. But, I found a script on Github for installation on Snow Leopard, so I ran: rails plugin install http://github.com/masterkain/ImageMagick-sl.git But, now I'm getting Undefined method has_attached_file I'm completely new to Rails and programming. Most of this is

How do I configure a JPEG delegate for graphicsmagick?

青春壹個敷衍的年華 提交于 2019-12-23 19:09:05
问题 I want to crop an image to a specified pixel region. I'd like to use the gm module from https://github.com/aheckmann/gm. I am running Linux Mint 13 and node.js v0.9.4pre. I am running into an error that sounds like graphicsmagick doesn't know about jpegs: Error: Command failed: gm convert: No decode delegate for this image format (./assets/images/temp/2aadd4379e1cf2b59429994270db2a8a.jpg) Sure enough, gm convert -list formats shows no jpeg delegate: <snip> IPTC P rw- IPTC Newsphoto IPTCTEXT P

Why do I get NoDecodeDelegateForThisImageFormat when rastering SVG to PNG with ImageMagick in PHP?

萝らか妹 提交于 2019-12-23 18:30:32
问题 I'm trying to convert svg image to png with the following code: $image = new Imagick(); $image->readImageBlob($_POST['svgcode']); $image->setImageFormat("png24"); $image->resizeImage(600, 600, imagick::FILTER_LANCZOS, 1); header('Content-type: image/png'); echo $image; But there is an error in the second line: NoDecodeDelegateForThisImageFormat `' @ error/blob.c/BlobToImage/361 How can I fix this? 回答1: First line of your svg must be <?xml version="1.0" encoding="UTF-8" standalone="no"?> $svg

Specify background colour when generating movie from images

回眸只為那壹抹淺笑 提交于 2019-12-23 18:25:29
问题 I generate a video from png images using ffmpeg -i visualization/%d.png -c:v libx264 -vf "scale=500:trunc(ow/a/2)*2" -pix_fmt yuv420p z.mov and if images have transparencies, they become black. Can I somehow make them white? 回答1: Before running ffmpeg, use ImageMagick to "flatten" each PNG against white. mogrify -background white -flatten visualization/*.png 来源: https://stackoverflow.com/questions/21723343/specify-background-colour-when-generating-movie-from-images

Imagick setColor not working with php

♀尐吖头ヾ 提交于 2019-12-23 16:35:55
问题 I've tried setting all pixels to black. But it isn't working. I am getting the same image as original. Here is my code: $image = new Imagick(__DIR__."/image_new.jpg"); $i=0; $j=0; while ($i < 100) { $j=0; while($j < 100) { $pixel = $image->getImagePixelColor($i, $j); $pixel->setColor("#000000"); $j++; } $i++; } header("content-type:image/jpeg"); echo $image; Image size is 100x100. Any ideas? 回答1: The Imagick::getImagePixelColor will return an ImagickPixel object; which, would have copied data

Incompatible library version: imagick.so requires version 18.0.0 or later, but libfreetype.6.dylib provides version 16.0.0 in Unknown on line 0

风流意气都作罢 提交于 2019-12-23 16:18:37
问题 I installed imagemagic and imagick successfully (using http://www.php.net/manual/en/imagick.installation.php#94169 steps ) and also put extension=imagick.so. but when i restart apache i am getting following error. Unable to load dynamic library /Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/imagick.so dlopen(/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/imagick.so, 9): Library not loaded: /usr/local/lib/libfreetype.6.dylib