The convex hull is the is the smallest area convex polygon containing the set of points inside it. The convex hull may be visualized as the shape enclosed by a rubber band stretched around the set of points.

The convex-hull string format returns a list of x,y coordinates of the vertices of the convex-hull polygon containing all the non-black pixels within it.

where the string format is sensitive to an optional -fuzz value and to an optional background color specified by the define. The command above will find the background color automatically according to the fuzz value unless the background color is defined. The fuzz value defaults to 0 when not specified.

For example, consider the following white rectangle on a black background:

The convex hull set of points may be computed as:

The convex hull may also be drawn as a polygon (filled or unfilled) using -draw as follows:

Here is an example using a non-convex shaped image on a black background:

Finally, here is an example with a non-constant, non-black background using -fuzz to determine the background color: