I'm trying to compare image difference before/after compression. Currently, I do it by saving image at certain quality factor as jpeg file and then call imread() to get the result.
However, the whole process contains several useless steps. For example, it is not necessary to encode image and generate a .jpg file. I would like to skip those unnecessary steps. Are there any approaches to get compressed image result like
compress_image = CompressAtQuality(source_image, quality_factor)