Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Rye
Posts: 158 Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789
Post
by Rye » 2013-08-18T03:20:38-07:00
Example:
Would be nice to also get an explanation.
Thanks in advance
Bonzo
Posts: 2971 Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England
Post
by Bonzo » 2013-08-18T03:31:32-07:00
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.
Rye
Posts: 158 Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789
Post
by Rye » 2013-08-18T03:46:46-07:00
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).
Bonzo
Posts: 2971 Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England
Post
by Bonzo » 2013-08-18T04:31:46-07:00
So you are not even going to try it yourself after I gave you the explanation above?
Code: Select all
convert crop.png -bordercolor black -border 1x1 -trim output.jpg
I will let you work out how to work on multiple images as the question has been asked multiple times on the forum.
Rye
Posts: 158 Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789
Post
by Rye » 2013-08-18T04:55:50-07:00
Ok, trim actually "is" simple enough. Always dazzles me how ImageMagick simplyfies thes processes
Rye
Posts: 158 Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789
Post
by Rye » 2013-08-18T08:17:30-07:00
These didn't come out like I wanted (a small border remains):
[spoiler]
[/spoiler]
Ideas ?
Bonzo
Posts: 2971 Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England
Post
by Bonzo » 2013-08-18T09:00:13-07:00
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