A lossless image compression algorithm using variable block size segmentation