如何使用ImageMagick像素化/模糊图像?

时间:2021-10-19 08:59:54

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

3 个解决方案

#1


5  

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


40  

To get a proper square pixellation, try:

要获得正确的方形像素化,请尝试:

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

#3


-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.

我对ImageMagick一无所知,但您可以尝试使用bicubic将图像调整到更小的尺寸,然后将图像调整为更大的尺寸。

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

这个技巧使用.net的System.Drawing对象。

#1


5  

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


40  

To get a proper square pixellation, try:

要获得正确的方形像素化,请尝试:

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

#3


-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.

我对ImageMagick一无所知,但您可以尝试使用bicubic将图像调整到更小的尺寸,然后将图像调整为更大的尺寸。

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

这个技巧使用.net的System.Drawing对象。