ImageMagickで線画抽出したときのメモ

ImageMagickで線画抽出

作業日:Mar 8, 2021

ImageMagick バージョン 7.0.10-50

$ convert --version
Version: ImageMagick 7.0.10-50 Q16 x86_64 2020-12-18 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5)
Delegates (built-in): bzlib freetype gslib heic jng jp2 jpeg lcms lqr ltdl lzma openexr png ps tiff webp xml zlib


元画像


$ convert input.jpg -colorspace gray \( +clone -blur 0x2 \) +swap -compose divide -composite -linear-stretch 0%x0% out.jpg

-linear-stretch を 0%~20% x 0%~100%で変遷した結果


5%x75%の結果。マシに見える。

"-blur 0x2" の部分は「どれだけトばすか」をいじっているように見えるけど、よくわからない。

左から0x1, 0x5, 0x50, 0x100


以下は、線画抽出で調べたときにメモしたその他のキーワード

equalize
canny 0
negate
convert input.jpg +dither -colors 4 out.jpg





コメント