I need to pixelate parts of an image using an mask image in tif format.
In ImageMagick there are multiple options to do it, for example:
convert -quality 100 source.tif \( -clone 0 -resize 16% -scale 3840x2160! \) \( unsharp_mask.tif \) -composite result.tif
The source image and the unsharp_mask image have the same size: 3840 x 2160
The unsharp_mask image is filled black except the areas which need to pixelated, they are white, in the source image.
How can I do it with GraphicsMagick?
Is there a simple way to achieve the same result?
Updated Answer
Well... with some time spent "dinking around", err, I mean assiduously studying the options, I come up with this which is both faster and also obviates the need for any intermediate files:
It produces the same result as below. If anyone is interested, MPR means "Memory Program Register" and it is basically a chunk of RAM with a name.
Original Answer
There may be a simpler method that you could work out by dinking around for ages, but this seems to do what I think you want.
This is my source image
source.tifand it is 400x400px:I pixellate it like this:
Then I make a mask like this - I have artificially added a red outline so you can see the extent on StackOverflow's white background:
And do the final composite like this:
By the way, see here for some thoughts on GraphicsMagick vs ImageMagick.