Binary encoding of features has proven to be a versatile tool for optimizing data processing and memory efficiency in various machine learning applications. This includes deep barcoding of images for retrieval of similar cases among millions of indexed images. Despite the recent advancement in barcode generation methods, converting hyperdimensional feature vectors (e.g., deep features) to compact and discriminative binary barcodes is still an urgent necessity and widely an unresolved problem. MinMax barcoding of features is one of the efficient binarization methods, where the accuracy of the generated barcodes is inherently dependent on the feature order due to its computation process. In this paper, we propose a combinatorial evolutionary framework for optimizing barcodes. The primary goal is to determine an optimal permutation of extracted deep features, leading to more accurate barcodes. The performance of the proposed model has been assessed in downstream image retrieval tasks using a variety of datasets. This evaluation includes medical images from The Cancer Genome Atlas (TCGA), a comprehensive publicly available dataset, as well as images from a COVID-19 dataset. In addition, the model's performance was tested on diverse non-medical image collections, such as CIFAR-10 and Fashion-MNIST. Our findings demonstrate that optimizing barcodes significantly enhances retrieval accuracy across a wide range of applications, highlighting the applicability and potential of barcodes in various domains.