Example:
Would be nice to also get an explanation.
Thanks in advance
How to crop this image so only the middle part remains ?
How to crop this image so only the middle part remains ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Re: How to crop this image so only the middle part remains ?
How much do you want to crop?
If you just want to remove the black lines on the sides you could add a black border to the whole image and then use -trim.
If you just wanted the star You could do as above and then add another -trim which should crop to the edges of the star.
If you just want to remove the black lines on the sides you could add a black border to the whole image and then use -trim.
If you just wanted the star You could do as above and then add another -trim which should crop to the edges of the star.
Re: How to crop this image so only the middle part remains ?
I want to crop the picture so only the white area remains.
As simple as possible.
Would be best if the command could be used on all png's in one folder (batch).
As simple as possible.
Would be best if the command could be used on all png's in one folder (batch).
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Re: How to crop this image so only the middle part remains ?
So you are not even going to try it yourself after I gave you the explanation above?
I will let you work out how to work on multiple images as the question has been asked multiple times on the forum.
Code: Select all
convert crop.png -bordercolor black -border 1x1 -trim output.jpg
Re: How to crop this image so only the middle part remains ?
Ok, trim actually "is" simple enough. Always dazzles me how ImageMagick simplyfies thes processes
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Re: How to crop this image so only the middle part remains ?
These didn't come out like I wanted (a small border remains):
[spoiler]
[/spoiler]
Ideas ?
[spoiler]
[/spoiler]
Ideas ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Re: How to crop this image so only the middle part remains ?
Your background is not exactly black; you need to add a -fuzz:
Code: Select all
convert crop.png -bordercolor black -border 1x1 -fuzz 10% -trim output.jpg