imagemagick-convert

Connected-component labeling with ImageMagick

半城伤御伤魂 提交于 2019-11-30 09:24:39
问题 Is it possible to perform a connected-component labeling on a image with ImageMagick? Connected-component labeling in Wikipedia 回答1: Yes, it is now possible with ImageMagick 6.8.9-10 and newer, see here. So, if we start with this image: we can get the components labelled and also the bounding boxes, centroids and other statistics for each blob or component like this: convert input.png \ -colorspace gray -negate -threshold 10% \ -define connected-components:verbose=true \ -define connected

ImageMagick: convert to keep same name for converted image

蹲街弑〆低调 提交于 2019-11-30 04:31:53
I am converting .psd to .png files inside folder with one. How to keep same name of every file in folder with different extension ? For example I enter in folder images and then from terminal I execute $ convert *.psd *.png but it gives names to .png just numbers not the same as appropriate .psd image. Use the -set and formatting options. convert *.psd -set filename:base "%[basename]" "%[filename:base].png" See " Long Form Attribute Percent Escapes " and " Filename Percent Escapes " docs. Update The mogrify utility that ships with imagemagick can also be used. mogrify -format png *.psd Note:

Converting a multi page pdf to multiple pages using a single command

依然范特西╮ 提交于 2019-11-30 04:27:28
I want to convert multi page pdfs into single page images efficiently. I already know how to do this one page at a time with imagemagick. For example, convert x.pdf[2] x3.jpg will give me the 3rd page of the pdf as an image. So if I figure out how many pages are in the pdf using identify then I can loop through and convert all pages in the pdf to images. This method can however take a while. For example a 15 page pdf could take anywhere between 15-30 seconds. According to answers that I have seen elsewhere (also on the imagemagick forums) the following imagemagick command should split a pdf

ImageMagick: Lossless max compression for PNG?

我的未来我决定 提交于 2019-11-29 22:56:15
I'd like to achieve a maximum amount of compression when saving to a lossless PNG using ImageMagick. I'm doing batch conversion of many PSDs. I tried a few things, but it looks to me like the resulting PNG image is not as sharp as original image, although my wife cannot see it. These are current arguments I'm playing with: convert -depth 24 -define png:compression-filter=1 \ -define png:compression-level=9 -define png:compression-strategy=2 According to: http://www.imagemagick.org/script/command-line-options.php#define And http://www.w3.org/TR/PNG-Filters.html That means: compression filter is

ImageMagick security policy 'PDF' blocking conversion

一个人想着一个人 提交于 2019-11-29 20:32:10
The Imagemagick security policy seems to be not allowing me perform this conversion from pdf to png. Converting other extensions seem to be working, just not from pdf. I haven't changed any of the imagemagick settings since I installed it... I am using Arch Linux, if the OS matters. user@machine $ convert -density 300 -depth 8 -quality 90 input.pdf output.png convert: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408. convert: no images defined `output.png' @ error/convert.c/ConvertImageCommand/3288. Well, I added <policy domain

GIF Image getting distorted on interlacing

久未见 提交于 2019-11-29 15:43:35
I have a few images that were converted using Imagemagick and its interlaced operation. These were the animated GIF images. The issue is that, while converting, the images have distorted and I do not have original images with me as it was the previous developer who did the wonderful thing. The GIF is no more animating and each frame has 4 copies of the same frame with decreasing sizes. I have not worked much on Imagemagick before. Is there any way I can restore the original image from the distorted version? The command used was: convert <old-file.gif> -interlace plane <new-file.gif> Thanks

Connected-component labeling with ImageMagick

坚强是说给别人听的谎言 提交于 2019-11-29 15:36:18
Is it possible to perform a connected-component labeling on a image with ImageMagick? Connected-component labeling in Wikipedia Yes, it is now possible with ImageMagick 6.8.9-10 and newer, see here . So, if we start with this image: we can get the components labelled and also the bounding boxes, centroids and other statistics for each blob or component like this: convert input.png \ -colorspace gray -negate -threshold 10% \ -define connected-components:verbose=true \ -define connected-components:area-threshold=100 \ -connected-components 8 -auto-level output.png Objects (id: bounding-box

ImageMagick - Making 2 GIFs into side by side GIFs using IM convert

你。 提交于 2019-11-29 14:55:10
问题 I have 2 GIFs that are the same length. I want to put the GIFs beside each other to have 1 GIF with both playing at the same time. I have tried to use the convert tool with: convert +append 1.gif1 2.gif output.gif However, this seems to blend all the images together and changes the size to be extremely small. I was thinking that I could append each image together and then create a GIF out of those already combined images. However it did not work when I tried: convert -delay 15 -loop 0 1*.png

ImageMagick: convert to keep same name for converted image

99封情书 提交于 2019-11-29 01:44:45
问题 I am converting .psd to .png files inside folder with one. How to keep same name of every file in folder with different extension ? For example I enter in folder images and then from terminal I execute $ convert *.psd *.png but it gives names to .png just numbers not the same as appropriate .psd image. 回答1: Use the -set and formatting options. convert *.psd -set filename:base "%[basename]" "%[filename:base].png" See "Long Form Attribute Percent Escapes" and "Filename Percent Escapes" docs.

ImageMagick convert pdf to jpeg has poor text quality after upgrading ImageMagick version to 6.7.8

◇◆丶佛笑我妖孽 提交于 2019-11-28 17:14:51
After upgrading ImageMagick text quality got degraded when convert pdf to jpeg: Old image New Image Conversion command: convert foo.pdf foo.jpeg Old ImageMagick version: [root@home]# convert -version Version: ImageMagick 6.2.8 05/07/12 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC generated files size: -rw-r--r-- 1 root root 139K Apr 2 16:11 foo-0.jpeg -rw-r--r-- 1 root root 130K Apr 2 16:11 foo-1.jpeg -rw-r--r-- 1 root root 334K Mar 24 14:27 foo.pdf After upgrading ImageMagick [root@home]# convert -version Version: ImageMagick 6