Ask Your Question

Revision history [back]

how to get JPG compressed image yuv/rgb result from source image

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)

how to get JPG compressed image yuv/rgb result from source image

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() 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 likelike.

compress_image = CompressAtQuality(source_image, quality_factor)

quality_factor)