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