mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-02-07 06:19:03 +00:00
23 lines
13 KiB
HTML
23 lines
13 KiB
HTML
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>Command line: ImageMagick</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
|
|
MathJax = {
|
|
tex: {
|
|
inlineMath: [ ['$','$'], ['\(','\)'] ],
|
|
displayMath: [ ['$$','$$'], ['[',']'] ]
|
|
},
|
|
options = {
|
|
processHtmlClass = "math"
|
|
}
|
|
}
|
|
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>Command line: ImageMagick</h1><section class="post-metadata"><span>Date: <!-- -->2021-05-09 19:55:50 +08:00</span><span>Date modified: <!-- -->2021-07-20 23:31:03 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h1"><a href="/wiki/cli.imagemagick#synopsis" class="toc-link toc-link-h1">Synopsis</a></li><li class="toc-item toc-item-h1"><a href="/wiki/cli.imagemagick#subcommands" class="toc-link toc-link-h1">Subcommands</a></li><li class="toc-item toc-item-h1"><a href="/wiki/cli.imagemagick#examples" class="toc-link toc-link-h1">Examples</a><ol class="toc-level toc-level-2"><li class="toc-item toc-item-h2"><a href="/wiki/cli.imagemagick#resize-an-image-by-half" class="toc-link toc-link-h2">Resize an image by half</a></li><li class="toc-item toc-item-h2"><a href="/wiki/cli.imagemagick#print-the-information" class="toc-link toc-link-h2">Print the information</a></li><li class="toc-item toc-item-h2"><a href="/wiki/cli.imagemagick#use-imagemagick-as-a-color-picker" class="toc-link toc-link-h2">Use ImageMagick as a color picker</a></li></ol></li></ol></nav><p>The swiss army knife for picture manipulation in the command line.
|
|
For future reference, this mainly use v7 which has Git-style interface (which is way better, IMO).
|
|
</p><h1 id="synopsis">Synopsis</h1><pre class="src-block"><code class="language-shell">magick [subcommand [subcommand_options...]]
|
|
</code></pre><h1 id="subcommands">Subcommands</h1><ul><li><p><code class="inline-verbatim">convert</code> - resize images, convert between formats, apply filter effects
|
|
</p></li><li><p><code class="inline-verbatim">identify</code> - print information on the image
|
|
</p></li><li><p><code class="inline-verbatim">mogrify</code> - similar to <code class="inline-verbatim">convert</code> except modifies the original file
|
|
</p></li></ul><h1 id="examples">Examples</h1><p>A comprehensive tool calls for a comprehensive introduction.
|
|
</p><h2 id="resize-an-image-by-half">Resize an image by half</h2><pre class="src-block"><code class="language-shell">magick resize $INPUT -resize 50% $OUTPUT
|
|
</code></pre><p>You can find out various geometry options from the <a href="https://imagemagick.org/script/command-line-processing.php#geometry">documentation</a>.
|
|
</p><h2 id="print-the-information">Print the information</h2><pre class="src-block"><code class="language-shell">magick identify $INPUT
|
|
</code></pre><h2 id="use-imagemagick-as-a-color-picker">Use ImageMagick as a color picker</h2><p>You can use any tool that can pipe an image to other tools.
|
|
</p><pre class="src-block"><code class="language-shell">maim --select --shader crosshair --tolerance 0 --hidecursor | magick convert - -resize 1x1\! -format '%[hex:p{0,0}]' info:-
|
|
</code></pre></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"\"2021-05-09 19:55:50 +08:00\"","date_modified":"\"2021-07-20 23:31:03 +08:00\"","language":"en","source":""},"title":"Command line: ImageMagick","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"synopsis"},"children":[{"type":"text","value":"Synopsis"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/cli.imagemagick#synopsis"},"children":[{"type":"text","value":"Synopsis"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"subcommands"},"children":[{"type":"text","value":"Subcommands"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/cli.imagemagick#subcommands"},"children":[{"type":"text","value":"Subcommands"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"examples"},"children":[{"type":"text","value":"Examples"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/cli.imagemagick#examples"},"children":[{"type":"text","value":"Examples"}]},{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-2"},"children":[{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h2","properties":{"id":"resize-an-image-by-half"},"children":[{"type":"text","value":"Resize an image by half"}]}]},"properties":{"className":"toc-item toc-item-h2"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h2","href":"/cli.imagemagick#resize-an-image-by-half"},"children":[{"type":"text","value":"Resize an image by half"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h2","properties":{"id":"print-the-information"},"children":[{"type":"text","value":"Print the information"}]}]},"properties":{"className":"toc-item toc-item-h2"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h2","href":"/cli.imagemagick#print-the-information"},"children":[{"type":"text","value":"Print the information"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h2","properties":{"id":"use-imagemagick-as-a-color-picker"},"children":[{"type":"text","value":"Use ImageMagick as a color picker"}]}]},"properties":{"className":"toc-item toc-item-h2"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h2","href":"/cli.imagemagick#use-imagemagick-as-a-color-picker"},"children":[{"type":"text","value":"Use ImageMagick as a color picker"}]}]}]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The swiss army knife for picture manipulation in the command line.\nFor future reference, this mainly use v7 which has Git-style interface (which is way better, IMO).\n"}]},{"type":"element","tagName":"h1","properties":{"id":"synopsis"},"children":[{"type":"text","value":"Synopsis"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"magick [subcommand [subcommand_options...]]\n"}]}]},{"type":"element","tagName":"h1","properties":{"id":"subcommands"},"children":[{"type":"text","value":"Subcommands"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"convert"}]},{"type":"text","value":" - resize images, convert between formats, apply filter effects\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"identify"}]},{"type":"text","value":" - print information on the image\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"mogrify"}]},{"type":"text","value":" - similar to "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"convert"}]},{"type":"text","value":" except modifies the original file\n"}]}]}]},{"type":"element","tagName":"h1","properties":{"id":"examples"},"children":[{"type":"text","value":"Examples"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"A comprehensive tool calls for a comprehensive introduction.\n"}]},{"type":"element","tagName":"h2","properties":{"id":"resize-an-image-by-half"},"children":[{"type":"text","value":"Resize an image by half"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"magick resize $INPUT -resize 50% $OUTPUT\n"}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can find out various geometry options from the "},{"type":"element","tagName":"a","properties":{"href":"https://imagemagick.org/script/command-line-processing.php#geometry"},"children":[{"type":"text","value":"documentation"}]},{"type":"text","value":".\n"}]},{"type":"element","tagName":"h2","properties":{"id":"print-the-information"},"children":[{"type":"text","value":"Print the information"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"magick identify $INPUT\n"}]}]},{"type":"element","tagName":"h2","properties":{"id":"use-imagemagick-as-a-color-picker"},"children":[{"type":"text","value":"Use ImageMagick as a color picker"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can use any tool that can pipe an image to other tools.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"maim --select --shader crosshair --tolerance 0 --hidecursor | magick convert - -resize 1x1\\! -format '%[hex:p{0,0}]' info:-\n"}]}]}]},"backlinks":[]},"__N_SSG":true},"page":"/[[...slug]]","query":{"slug":["cli.imagemagick"]},"buildId":"Ie9t5zutrXP6Of75Cb5xF","assetPrefix":"/wiki","nextExport":false,"isFallback":false,"gsp":true}</script><script nomodule="" src="/wiki/_next/static/chunks/polyfills-99d808df29361cf7ffb1.js"></script><script src="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" async=""></script><script src="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" async=""></script><script src="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" async=""></script><script src="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" async=""></script><script src="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" async=""></script><script src="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" async=""></script><script src="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_buildManifest.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_ssgManifest.js" async=""></script></body></html> |