imagemagick-convert

ImageMagick multiple operations in single invocation

僤鯓⒐⒋嵵緔 提交于 2019-12-03 08:49:06
I'm trying to get ImageMagick to perform multiple operations (in this case, crops) in a single invocation, but it doesn't seem to be possible. For example, I can do a crop, rotate, and then another crop as two separate commands: $ convert test.jpg -crop 223x187+588+757 -rotate 330 crop2.jpg $ convert crop2.jpg -crop 200x100+43+87 crop3.jpg But if I try to combine them into a single command, I get an error: $ convert test.jpg -crop 223x187+588+757 -rotate 330 -crop 200x100+43+87 crop3.jpg convert: geometry does not contain image `test.jpg' @ warning/transform.c/CropImage/666. Obviously I could

In ImageMagick, how can I scale an image down just enough so it's cropped to particular dimensions?

烈酒焚心 提交于 2019-12-03 07:30:54
问题 For example, if I have a large image that's 1600x1200, but I want to generate a thumbnail that is 250x200 (a different ratio of height and width) -- how can I scale this down to size and then center crop it? Is this possible in one line using convert? 回答1: Scale down + fill given area (and stretch output image if required) If you want to scale down to 250x200 pixels (without keeping the aspect ratio), completely filling the space of 250x200 (stretching/distorting the image if necessary), use:

Defining the file order for ImageMagick convert

瘦欲@ 提交于 2019-12-03 06:22:53
I have a bunch of PNG files named foo<bar>.png I wish to convert to TIF animation. <bar> is a number varies from 0 to 25 in leaps of five. ImageMagick place foo5.png last in the animation while it is supposed to be second. Is there a way, apart from renaming the file to foo05.png to place it in the right place? You just give the order of your PNG files as they should appear in the animation. Use: foo0.png foo5.png foo10.png foo15.png foo20.png foo25.png instead of foo*.png After all, it's only 6 different file names which should be easy enough to type: convert \ -delay 10 \ foo0.png foo5.png

ImageMagick: No decode delegate for this image format `' @ error/constitute.c/ReadImage/504

懵懂的女人 提交于 2019-12-03 05:40:10
问题 Problem: ImageMagick convert is unable to crop image. It looks like it doesn't recognize the image type? What I've Tried: I've searched around online and I've seen several similar issues but not mine. I've attempted their solutions including Uninstalling and reinstalling ImageMagick via brew. identify -list format (JPEG, GIF, PNG, TIFF, etc were all there and all had rw permissions) convert -version (png is is among the built-in delegates) convert pic1.png pic1-jpg.jpg (this worked fine)

Creating a semi-transparent PNG with ImageMagick on Centos Linux

白昼怎懂夜的黑 提交于 2019-12-03 03:18:10
I have PNG files that I would like to convert the whole image to be semi-transparent. The image will be referenced in a KML file as an icon overlay for use in Google Earth/Maps. The following examples have been suggested to me using the ImageMagick convert command, however neither seems to work. The first example results in an error, the second example fails to make any observable change to the image. $ /usr/local/bin/convert 121112142121.png -channel Alpha -evaluate Set 50% 2121112142121.png convert: no decode delegate for this image format '121112142121.png' @ error/constitute.c/ReadImage

ImageMagick: No decode delegate for this image format `' @ error/constitute.c/ReadImage/504

醉酒当歌 提交于 2019-12-02 20:25:11
Problem: ImageMagick convert is unable to crop image. It looks like it doesn't recognize the image type? What I've Tried: I've searched around online and I've seen several similar issues but not mine. I've attempted their solutions including Uninstalling and reinstalling ImageMagick via brew. identify -list format (JPEG, GIF, PNG, TIFF, etc were all there and all had rw permissions) convert -version (png is is among the built-in delegates) convert pic1.png pic1-jpg.jpg (this worked fine) convert pic1-jpg.jpg pic1-jpg.jpg (this worked fine) convert pic1-jpg.jpg 805X972+34+94 pic1-jpg-crop.jpg

ImageMagick: how to batch combine multiple TIFF file to a single TIFF file in a directory?

ぃ、小莉子 提交于 2019-12-02 00:56:55
问题 I have 600 TIFF files in a directory, c:\temp. The file names are like: 001_1.tif, 001_2.tif, 001_3.tif 002_1.tif, 002_2.tif, 002_3.tif .... .... 200_1.tif, 200_2.tif, 200_3.tif The combined files should be placed in same directory and the files should be named like: 1_merged.tif 2_merged.tif ..... ..... 200_merged.tif I am looking for any single command-line /batch-file to do so through ImageMagick convert / mogrify command or any other command/tools. Please note the overall time taken

Replace only background color of PNG

*爱你&永不变心* 提交于 2019-12-02 00:39:47
Here is my code: #! /usr/bin/env sh # Generate test image. convert -size 100x60 xc:blue -fill blue -stroke black -draw "circle 50,30 55,55" in.png # Make background transparent. convert in.png -fill none -draw 'matte 0,0 floodfill' -flop -draw 'matte 0,0 floodfill' -flop out.png # Replace transparent background with green. mogrify -background green -flatten out.png # The wrong way. convert in.png -transparent blue oops.png mogrify -background green -flatten oops.png It is based on this snippet: https://snippets.aktagon.com/snippets/558-how-to-remove-a-background-with-imagemagick Starting with

ImageMagick: how to batch combine multiple TIFF file to a single TIFF file in a directory?

我只是一个虾纸丫 提交于 2019-12-01 21:10:27
I have 600 TIFF files in a directory, c:\temp. The file names are like: 001_1.tif, 001_2.tif, 001_3.tif 002_1.tif, 002_2.tif, 002_3.tif .... .... 200_1.tif, 200_2.tif, 200_3.tif The combined files should be placed in same directory and the files should be named like: 1_merged.tif 2_merged.tif ..... ..... 200_merged.tif I am looking for any single command-line /batch-file to do so through ImageMagick convert / mogrify command or any other command/tools. Please note the overall time taken should not be more than 5 second. Assuming you want to combine the 600 single-page TIFFs into one single

ImageMagick trimming to a border

淺唱寂寞╮ 提交于 2019-12-01 13:32:50
I'm using ImageMagick to trim margins off of a scanned page. The page has a black border and for our purposes looks something like this: These are scans though, so there's often dust and other gunk making things less pretty. The command I'm using for the trimming is: convert <filename> -crop \ `convert <filename> -virtual-pixel edge -blur 0x15 -fuzz 40% -trim \ -format '%wx%h%O' info:` +repage <filename> This is mostly copied from various forums (I don't know what -format does, for instance). And it works well when the image has the black border and not much else outside it. Sometimes, however