A general algorithm for computing Euclidean skeletons of 2D and 3D data sets in linear time is presented. These skeletons are defined in terms of a new concept, called the integer medial axis (IMA) transform. We prove a number of fundamental properties of the IMA skeleton, and compare these with properties of the CMD (centers of maximal disks) skeleton. Several pruning methods for IMA skeletons are introduced (constant, linear and square-root pruning) and their properties studied. The algorithm for computing the IMA skeleton is based upon the feature transform, using a modification of a linear-time algorithm for Euclidean distance transforms. The skeletonization algorithm has a time complexity which is linear in the number of input points, and can be easily parallelized. We present experimental results for several data sets, looking at skeleton quality, memory usage and computation time, both for 2D images and 3D volumes.