ImageMagick

How to square an image and pad with transparency from the commandline (imagemagick)

痞子三分冷 提交于 2020-01-23 12:05:26
问题 The section entitled Square Padding or Cropping describes a method to generate a square image--for a file whose dimensions are unknown--and pad the background with a color. How do I perform the same operation, but create a transparent background. 回答1: These modified methods from Anthony's examples both work for me: convert thumbnail.gif \ \( +clone -rotate 90 +clone -mosaic +level-colors grey -transparent grey \) \ +swap -gravity center -composite square_padded.gif convert thumbnail.gif

How to square an image and pad with transparency from the commandline (imagemagick)

我的未来我决定 提交于 2020-01-23 12:05:24
问题 The section entitled Square Padding or Cropping describes a method to generate a square image--for a file whose dimensions are unknown--and pad the background with a color. How do I perform the same operation, but create a transparent background. 回答1: These modified methods from Anthony's examples both work for me: convert thumbnail.gif \ \( +clone -rotate 90 +clone -mosaic +level-colors grey -transparent grey \) \ +swap -gravity center -composite square_padded.gif convert thumbnail.gif

How to make circle thumbnail with GraphicsMagick?

本小妞迷上赌 提交于 2020-01-23 03:39:11
问题 While exploring how to make circular crop with GraphicsMagick i came to that code: gm convert -thumbnail 200x200^ -extent 200x200 kira.jpg kira_new.jpg && gm convert -size 200x200 xc:none -fill white -draw "circle 100,100 110,0" tmp.png && gm composite -compose CopyOpacity tmp.png kira_new.jpg out.png Here's what it does: Creates 200x200 temp file named kira_new.jpg Creates transparent tmp.png with white circle in the middle Composition on tmp.png and kira_new.jpg So the question is: is there

ImageMagick No decode delegate for this image format

孤街醉人 提交于 2020-01-22 20:02:07
问题 I work under windows and wamp server. this is my PHP code with Imagick $imagick = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/' . $this->_name); where $_SERVER['DOCUMENT_ROOT'].'/'.$this->_name displays : D:/Sources/my_project/public/media/2/9/1/05201502/55450e1b6543a05201502_9.PNG I checked that image and it does exist in the folder. But Imagick throws an exception : Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `D:/Sources/my_project/public/media

How to convert gray scale png image to RGB from comand line using image magick

浪子不回头ぞ 提交于 2020-01-22 16:05:17
问题 I am trying to convert an png Gray scale image to RGB png image using the following command. convert HopeLoveJoy.png -size 1x1 -fill "rgba(0%,1%,2%,0)" -draw "color 511,511 point" out_test.png By using the above the above command I am able to convert but the color of the image is getting changed. Is any thing wrong in the command?? Any help is appreciated. Thanks in advance. 回答1: If, as your question title implies, you really just want to go from greyscale to sRGB colorspace, use this:

How to convert gray scale png image to RGB from comand line using image magick

被刻印的时光 ゝ 提交于 2020-01-22 16:03:27
问题 I am trying to convert an png Gray scale image to RGB png image using the following command. convert HopeLoveJoy.png -size 1x1 -fill "rgba(0%,1%,2%,0)" -draw "color 511,511 point" out_test.png By using the above the above command I am able to convert but the color of the image is getting changed. Is any thing wrong in the command?? Any help is appreciated. Thanks in advance. 回答1: If, as your question title implies, you really just want to go from greyscale to sRGB colorspace, use this:

How to convert gray scale png image to RGB from comand line using image magick

时光毁灭记忆、已成空白 提交于 2020-01-22 16:03:07
问题 I am trying to convert an png Gray scale image to RGB png image using the following command. convert HopeLoveJoy.png -size 1x1 -fill "rgba(0%,1%,2%,0)" -draw "color 511,511 point" out_test.png By using the above the above command I am able to convert but the color of the image is getting changed. Is any thing wrong in the command?? Any help is appreciated. Thanks in advance. 回答1: If, as your question title implies, you really just want to go from greyscale to sRGB colorspace, use this:

RMagick complaining about libMagickCore.5.dylib not found in OSX

浪子不回头ぞ 提交于 2020-01-22 13:23:53
问题 after running brew upgrade imagemagick , when I run rails s I'll get /Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': dlopen(/Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore.5.dylib (LoadError) Referenced from: /Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/rmagick-2.13.2/lib/RMagick2.bundle Reason: image not found - /Users/tomi/

RMagick complaining about libMagickCore.5.dylib not found in OSX

对着背影说爱祢 提交于 2020-01-22 13:22:06
问题 after running brew upgrade imagemagick , when I run rails s I'll get /Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': dlopen(/Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore.5.dylib (LoadError) Referenced from: /Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/rmagick-2.13.2/lib/RMagick2.bundle Reason: image not found - /Users/tomi/

Convert .pdf to images using RMagick & Ruby

老子叫甜甜 提交于 2020-01-22 05:21:07
问题 I'd like to take a pdf and convert it to images...each pdf page becoming a separate image. There's a similar post here: Convert a .doc or .pdf to an image and display a thumbnail in Ruby? But it doesn't cover how to make separate images for each page. 回答1: ImageMagick can do that with PDFs. Presumably RMagick can do it too, but I'm not familiar with it. EDIT: The code from the post you linked to: require 'RMagick' pdf = Magick::ImageList.new("doc.pdf") pdf is an ImageList object, which