Social media platforms such as Twitter, Facebook, and Flicker, and the evolution of digital image capturing devices have resulted in the generation of a massive number of images. Thus, we experienced exponential growth in digital image repositories in the last decade. Content-based image retrieval (CBIR) has been extensively employed to reduce the dependency on textual annotations for image searching. Effective feature descriptor is mandatory to retrieve the most relevant images from the repository. Additionally, CBIR methods often experience the semantic gap problem, which must be addressed. In this paper, we propose a novel texture feature descriptor, Directional Magnitude Local Hexadecimal Patterns (DMLHP), based on texture orientation and magnitude to retrieve the most relevant images. The objective of the proposed feature descriptor is to examine the relationship of neighboring pixels with their adjacent neighbors based on texture orientation and magnitude. Our DMLHP texture descriptor is capable of capturing the texture and semantic information of the images effectively with the same visual content. Furthermore, the proposed method employs a learning-based approach to lessen the semantic gap problem and to improve the understanding of the contents of query images to retrieve the relevant images. The presented descriptor provides remarkable results by achieving the average retrieval precision (ARP) of 66%, 92%, 83%, average retrieval recall (ARR) of 66%, 92%, 83%, average retrieval specificity (ARS) of 99%, 99%, 76%, and average retrieval accuracy (ARA) of 98%, 99%, 85% on the AT&T, MIT Vistex, and Brodatz Texture image repositories, respectively. Our experiments reveal that the proposed DMLHP descriptor achieves far better performance, i.e., 95% on AT&T, 92% on BT, and 99% on MIT Vistex, when used with a learning-based approach over a non-learning-based approach (similarity measure). Experimental results show that the proposed texture descriptor outperforms state-of-the-art descriptors such as LNIP, LTriDP, LNDP, LDGP, LEPSEG, and CSLBP for CBIR.INDEX TERMS Content-based image retrieval, Orientation-based pattern, Magnitude-based pattern, Similarity-based approach, Learning-based approach.