L
L
leonard2012-03-23 14:45:34
ImageMagick
leonard, 2012-03-23 14:45:34

Crop a single color background with ImageMagick

Good afternoon. Tell me which way to dig to solve this problem:
If the pictures are like this - www.ogo1.ru/upload/resize/09/09378da0514c84198a2f87eafbf34483_600x600.jpg

I would like to crop the white background to the borders of the object with one imagemagick. I know that it is possible, but Google still refuses to reveal the secret to me.

UPD: Answer found:
convert test.jpg -fuzz 5% -trim result.jpg
Thanks to the user(... IonianWind , hh tag doesn't want to work)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IonianWind, 2012-03-23
@leonard

PHP

$image = new Imagick($img_location);
$image->trimImage(0);
$image->writeImages($img_location, true);

for the console, I advise you to look here: ImageMagick v6 Examples - Cutting and Bordering

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question