ImageMagick

ImageMagick Reduces Colorspace to Gray

纵然是瞬间 提交于 2020-01-21 03:11:32
问题 I convert RGB and CMYK TIFF images to RGB JPEGs using convert a.tif -colorspace rgb a.jpg If the TIFF image contains only gray pixels, the colorspace of the resulting JPEG is gray, not RGB. How can I force ImageMagick to always use RGB? 回答1: Try this: convert a.tif -colorspace rgb -type truecolor a.jpg However, I have to ask: How exactly do you determine your verdict 'colorspace of resulting JPEG is gray, not RGB' ?!? The ImageMagick tool identify can look at the colorspace used by files. If

Why doesn't my Imagemagick convert consider the loop parameter?

丶灬走出姿态 提交于 2020-01-17 12:31:11
问题 I'm using this command: convert -delay 10 -loop 1 -density 300 myfile.pdf myfile.gif on Windows 10 and all works well except for the loop parameter: even if I set it to 1 , I always get an infinite loop. What am I doing wrong? 回答1: I did some experiments varying the -loop parameter from 0 through 3 and using a simple red frame followed by a blue frame as follows: for i in 0 1 2 3; do echo i=$i ((d=80+i)) convert -delay $d -loop $i -size 256x256 xc:red xc:blue a.gif identify -verbose a.gif |

Why doesn't my Imagemagick convert consider the loop parameter?

a 夏天 提交于 2020-01-17 12:28:59
问题 I'm using this command: convert -delay 10 -loop 1 -density 300 myfile.pdf myfile.gif on Windows 10 and all works well except for the loop parameter: even if I set it to 1 , I always get an infinite loop. What am I doing wrong? 回答1: I did some experiments varying the -loop parameter from 0 through 3 and using a simple red frame followed by a blue frame as follows: for i in 0 1 2 3; do echo i=$i ((d=80+i)) convert -delay $d -loop $i -size 256x256 xc:red xc:blue a.gif identify -verbose a.gif |

Is there a -level function in wand-py

扶醉桌前 提交于 2020-01-17 05:00:45
问题 Is there a -level function in wand-py to adjust the levels of an image? How do I access this ? 回答1: The -level operation, or MagickLevelImage C-API, does not currently exists in wand-py. However, wand.api makes adding support for this method very easy. Example extending the wand.image.Image class: from ctypes import c_void_p, c_double, c_int from wand.api import library from wand.image import Image # Define C-API method signatures library.MagickLevelImage.argtypes = [c_void_p, # wand c_double

Magick++ get pixel color. pixelpacket doesnt seem to exist anymore

拟墨画扇 提交于 2020-01-17 03:11:46
问题 I'm trying to get the color of a pixel in a jpg image and all the tutorials I can find online say to use pixelpacket which doesnt exist anymore. searching and searching through google i've found that getvirtualpixels might be the new way but that doesnt seem to exist in the newest version either. so how do I get the color of pixels from an image with an image cache? I do not need to set any pixels btw. Using windows10 and visual studio 2015 回答1: PixelPacket structures have been replaced with

mogrify resize file name with bracket

ε祈祈猫儿з 提交于 2020-01-17 01:49:07
问题 in php it failed when resize file name that include "(" bracket. normally I do exec("mogrify -resize {$filewidth}x{$fileheight}! \"$file\""); but it don't work with filename with bracket by command line have to escape like this for working. mogrify -resize 203x126! 53v-slave-only\(2\).png how to fix it for php by exec() command note filename must use bracket. thank you. 回答1: Try to use escapeshellcmd and escapeshellarg when using functions that works with the command line. For example: <?php

php proportionally resize and cut a circle out of a square image

女生的网名这么多〃 提交于 2020-01-16 18:45:12
问题 I have many square images with different sizes, and I want to first resize them so they are inside a 150pixel area (so the images are not distorted, so since most images are not exactly the same size on both height and width one of the sides would be smaller (proportionally). Then once I do that I need to cut a perfect circle out of them and apply a 10pixel colored border. Now how on earth could I even start this? 回答1: Well, you take your files from disk or however and then you use them to

php proportionally resize and cut a circle out of a square image

为君一笑 提交于 2020-01-16 18:45:06
问题 I have many square images with different sizes, and I want to first resize them so they are inside a 150pixel area (so the images are not distorted, so since most images are not exactly the same size on both height and width one of the sides would be smaller (proportionally). Then once I do that I need to cut a perfect circle out of them and apply a 10pixel colored border. Now how on earth could I even start this? 回答1: Well, you take your files from disk or however and then you use them to

Imagemagick svg to png conversion screws up text position

一曲冷凌霜 提交于 2020-01-16 17:04:12
问题 Trying to use Imagemagick's conversion tool to do basic SVG to PNG conversions, but the text positions are completely out of whack. For example, here's a vertical list of words in SVG: SVG: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="360" height="360" version="1.1" style="display:block;"> <rect width="100%" height="100%" fill="#FFFF00"/> <text x="0" y="20" font-size="12" text-anchor="start" fill="black" transform="">HELLO</text> <text x="0" y="40"

Imagemagick svg to png conversion screws up text position

空扰寡人 提交于 2020-01-16 17:03:10
问题 Trying to use Imagemagick's conversion tool to do basic SVG to PNG conversions, but the text positions are completely out of whack. For example, here's a vertical list of words in SVG: SVG: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="360" height="360" version="1.1" style="display:block;"> <rect width="100%" height="100%" fill="#FFFF00"/> <text x="0" y="20" font-size="12" text-anchor="start" fill="black" transform="">HELLO</text> <text x="0" y="40"