Вопрос

On either TurboJpeg or the underlying libJpeg APIs - is there a simple function for extracting the Y component from the Ycbcr (after I've already read the image)?

I know I can loop over the data and extract the bytes. Isn't this already implemented?

Это было полезно?

Решение

When decompressing/decoding, use the TJPF_GRAY format, it discards the colour information and only the Y (luminescence) remains.

See the this part of the API for reference, as well as that part if you are willing to transform it, or this function if you are willing to decode it directly into a gray-scale image.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top