# The ImageCrackCode Module (PIL Plus)

The ImageCrackCode module allows you to detect and measure features in an image. This module is only available in the PIL Plus package.

## Functions

### CrackCode (class)

`CrackCode(image, position)` identifies a feature in the given image. If the position is omitted, the constructor searches from the top left corner.

## Methods and attributes

### area

`area` (attribute). The feature area, in pixels.

### bbox

`bbox` (attribute). The bounding box, given as a 4-tuple (left, upper, right, lower).

### caliper

`caliper` (attribute). The caliper size, given as a 2-tuple (height, width).

### centroid

`centroid` (attribute). The center of gravity.

### edge

`edge` (attribute). True if the feature touches the edges of the image, zero otherwise.

### links

`links` (attribute). The number of links in the crack code chain.

### offset

`offset` (attribute). The offset from the upper left corner of the image, to the feature's bounding box,

### start

`start` (attribute). The first coordinate in the crack code chain.

### top

`top` (attribute). The topmost coordinate in the crack code chain.

### hit

`hit(xy)`. Check if the given point is inside this feature.

### topath

`topath(xy)`. Return crack code outline as an ImagePath object.

### getmask

`getmask()`. Get filled feature mask, as an image object.

### getoutline

`getoutline()`. Get feature outline, as an image object.