Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top