以下のバッチを実行します。
元画像(sample8.jpg)

rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.4-Q16
rem 右三角%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{i,(j*w-i*h*0.5)/(w-i)}" sample169a.png
出力画像(sample169a.png)

rem 右台形
%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{i,(j*w-i*h*0.25)/(w-i*0.5)}" sample169b.png
出力画像(sample169b.png)

rem 左三角
%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{i,(j*w-(w-i)*h*0.5)/(i+1)}" sample169c.png
出力画像(sample169c.png)

rem 左台形
%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{i,(j*w-(w-i)*h*0.25)/((w+i)*0.5)}" sample169d.png
出力画像(sample169d.png)

rem 下三角
%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{(i*h-j*w*0.5)/(h-j),j}" sample169e.png
出力画像(sample169e.png)

rem 下台形
%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{(i*h-j*w*0.25)/(h-j*0.5),j}" sample169f.png
出力画像(sample169f.png)

rem 上三角
%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{(i*h-(h-j)*w*0.5)/(j+1),j}" sample169g.png
出力画像(sample169g.png)

rem 上台形
%im%\convert.exe sample8.jpg -virtual-pixel background -background white -fx "p{(i*h-(h-j)*w*0.25)/((h+j)*0.5),j}" sample169h.png
出力画像(sample169d.png)

関連項目
ImageMagickで台形変形を行う
No comments:
Post a Comment