Answer the question
In order to leave comments, you need to log in
How to do partial image resizing in imagemagick?
Hello.
I need to solve the following problem: compress an image around the edges using imagemagick, preferably in one command (should be done on the fly).
Something like this:
(in the photo, the eyes remained in place, and the cheeks became closer to the center)
That is, so that, say, an area of 20% at the edges turns into a 2-fold shrink (it can be linear, it can be smooth)
Answer the question
In order to leave comments, you need to log in
Found the solution myself:
convert test.jpg
\( +clone -crop 200x1000+0+0 -sample 100x\! +repage \) -geometry +100+0 -composite
\( +clone -crop 200x1000+800+0 -sample 100x\! +repage \) -geometry +800+0 -composite
\( +clone -crop 1000x200+0+0 -sample x100\! +repage \) -geometry +0+100 -composite
test_result.jpg
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question