Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top