Trim Whitespace

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?".
Post Reply
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp » 2006-06-05T05:26:22-07:00

$ convert -trim logo: -verbose logo-trimmed.png
logo:=>logo-trimmed.png LOGO 640x480=>464x479 640x480+88+1

User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp » 2006-06-13T22:00:33-07:00

Gethin wrote: Just to clarify, in your example it gives an output of:

464x479 640x480+88+1.

Does this mean that pixel has been trimmed from the top/bottom, 88 from the left and 88 from the right? If this is so, any idea why my images give +0+0 as the output?

It means the resulting image is 464x479, the original was 640x480,
and the resulting image's top left corner was at 88,1 in the original.
e.g

in.png=>out.png PNG 1750x2750=>1296x2492+0+0 DirectClass 8-bit 525kb 0.750u 0:01

The numbers seem to be in a different order, perhaps because of some change between ImageMagick versions. Looks like your original
was 1750x2750, your result is 1296x2492, and the upper left corners
are coincident (i.e., the right edge and bottom edge were cropped off).

Post Reply