Texture is a fundamental feature which provides significant information for image classification, and is an important content used in content-based image retrieval (CBIR) system. To implement texture-based image database retrieval, texture segmentation techniques are need to segment textured regions from arbitrary images in the database. Texture segmentation has been recognized as a difficult problem in image analysis. This paper proposed a block-wise automatic texture segmentation algorithm based on texture features in wavelet domain. In this algorithm, texture features of each block are extracted and L2 distance between blocks are calculated; a pre-defined threshold is used to determine if two blocks should be classified into same class, hence belong to same textured region. Results show that the proposed algorithm can efficiently catch the texture mosaics of arbitrary images. In addition, features of each textured region can be obtained directly and used for image retrieval. Applying various thresholds instead of uniform threshold to different blocks according to their homogeneity property, texture segmentation performance can be further improved. Applied to image database, the proposed algorithm shows promising retrieval performance based on texture features.