An encoding device has a shape encoding unit and a pattern encoding unit.
The shape encoding unit encodes a shape of an image element. The pattern
encoding unit encodes a binary pattern of the image element and the shape
of the image element is related to the binary pattern of the image
element.