OcttKB/Wiki-OcttKB/tiddlers/Normal/_ImageMagick.tid

36 lines
2.2 KiB
Plaintext

created: 20230117104437158
creator: Octt
modified: 20240213224615601
modifier: Octt
tags: $:/i18n:en
title: ImageMagick
<<^wikipediaframe ImageMagick en>>
!!! ''How to''
* [[Color Modifications|https://www.imagemagick.org/Usage/color_mods/]] --- includes [[Modulation of Brightness, Saturation, and Hue|https://www.imagemagick.org/Usage/color_mods/#modulate]]
* [[Compositing Images|https://www.imagemagick.org/Usage/compose/]]
* [[Convert pdf to pdf without losing quality|https://stackoverflow.com/questions/49899547/imagemagik-convert-pdf-to-pdf-without-doing-anything#49900085]]
** //you have to upsize and put density first, e.g: `convert -density 288 input.pdf -resize 25% output.pdf`//
* [[Cutting and Bordering|https://www.imagemagick.org/Usage/crop/]]
** [[How to crop an image?|https://superuser.com/questions/1161340/how-to-crop-an-image-using-imagemagick-from-the-command-line#1161341]]
** The most classic crop command is `-crop <Width>x<Height>+<OffsetX>+<OffsetY>`
* [[Vertically stack multiple images|https://superuser.com/questions/290656/vertically-stack-multiple-images-using-imagemagick]] --- //`convert -append in-*.jpg out.jpg`//
* [[create a .png file which is just a solid rectangle|https://stackoverflow.com/questions/7771975/imagemagick-create-a-png-file-which-is-just-a-solid-rectangle#7772288]] --- //`convert -size 100x100 xc:#990000 whatever.png`//
!!! ''Troubleshooting''
* [[ImageMagick using too much memory to convert PDF files|https://stackoverflow.com/questions/15384879/imagemagick-using-more-than-2gb-of-memory-to-convert-pdf-files]]
** How to limit resources used? [[-limit type value|http://www.imagemagick.org/script/command-line-options.php#limit]]
* [[Error "cache resources exhausted"|https://stackoverflow.com/questions/31407010/cache-resources-exhausted-imagemagick#53699200]]
** [[ImageMagick can come with very low limits|https://github.com/ImageMagick/ImageMagick/issues/396#issuecomment-326849298]], example before and after fix
* [[security policy 'PDF' blocking conversion|https://stackoverflow.com/a/59193253]]
** Edit `/etc/ImageMagick-7/policy.xml` to comment out a line like `<policy domain="coder" rights="none" pattern="PDF" />`, OR edit `rights="[...]"` to `rights="read|write"`