The widely applied JPEG standard has undergone recent efforts using population-based metaheuristic (PBMH) algorithms to optimise quantisation tables (QTs) for specific images. However, user preferences, like an Android developer’s preference for small-size images, are often overlooked, leading to high-quality images with large file sizes. Another limitation is the lack of comprehensive coverage in current QTs, failing to accommodate all possible combinations of file size and quality. Therefore, this paper aims to propose three distinct contributions. First, to include the user’s opinion in the compression process, the file size of the output image can be controlled by a user in advance. To this end, we propose a novel objective function for population-based JPEG image compression. Second, we suggest a novel representation to tackle the lack of comprehensive coverage. Our proposed representation can not only provide more comprehensive coverage but also find the proper value for the quality factor for a specific image without any background knowledge. Both representation and objective function changes are independent of the search strategies and can be used with any population-based metaheuristic (PBMH) algorithm. Therefore, as the third contribution, we also provide a comprehensive benchmark on 22 state-of-the-art and recently-introduced PBMH algorithms on our new formulation of JPEG image compression. Our extensive experiments on different benchmark images and in terms of different criteria show that our novel formulation for JPEG image compression can work effectively.