how -trim images with black border and black background

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?".
pet
Posts: 13
Joined: 2013-08-13T10:11:30-07:00
Authentication code: 6789
Location: Switzerland

Re: how -trim images with black border and black background

Post by pet »

oh ... thanks :D
with the -format "%@" the script can run faster.
i think the performance of the script is a important factor for very large and thousends of images.

pet
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how -trim images with black border and black background

Post by fmw42 »

I am not sure it really will run faster, but it does not hurt to use that. Only timing tests will tell or the IM developers, who would know.
pet
Posts: 13
Joined: 2013-08-13T10:11:30-07:00
Authentication code: 6789
Location: Switzerland

Re: how -trim images with black border and black background

Post by pet »

fmw42 wrote: convert Q.jpg -fuzz 20% -format "%@" info:
319x121+15+39
or
convert Q.jpg -fuzz 20% -format "%@" info: | tr "x" " " | sed 's/+/ +/g'
319 121 +15 +39
vs
convert Q.jpg -fuzz 20% -trim -format "%w %h %X %Y" info:
319 121 +15 +39
i tested the different way with 20 large images ,
is exactly the same run-time




--
Post Reply