How to pixelate/blur an image using ImageMagick?

只愿长相守 提交于 2021-02-18 05:13:46

问题


I want to pixelate and/or blur an image. I've found the command for the blurring:

$convert image.jpg -blur 18,5 newimage.jpg

to work but I cannot blur the image any more. And how do I pixelate the image? I couldn't find a sound example around the net.

Thx


回答1:


This worked nicely for me, gives a sort of cross between pixelating and blurring:

convert -resize 10% image.jpg newimage.jpg
convert -resize 1000% newimage.jpg newimage.jpg

You can be sure that the data cannot be retrieved, should that be important to you.

Changing the %ages will change the amount of pixelation/blur




回答2:


To get a proper square pixellation, try:

convert -scale 10% -scale 1000% original.jpg pixelated.jpg



回答3:


I don't know anything about ImageMagick, but you can try resizing the image using bicubic to a much smaller dimension, then resizing the image back to a bigger one.

The trick works using .net's System.Drawing object.



来源:https://stackoverflow.com/questions/331254/how-to-pixelate-blur-an-image-using-imagemagick

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!