Colour differences between RenderCapture output and actual video
#1
Hi,

I'm messing around with the RenderCapture functionalities, and found that there's quite a difference between a captured image (byte-array converted to png with PIL) and the actual video output.

Compare this RenderCapture:
Image
With this screenshot:
Image

I'm sure there's a good reason for this; I just wanted to post this to see if anyone can explain it to me Smile

Thanks!

PS Whoa! I just noticed the colour of the woman's pull-over is completely different too!
Reply
#2
i've never used RenderCapture, so this is just a wild guess...
since it looks to me like red and blue are swapped in the image, you might need to use:
http://mirrors.xbmc.org/docs/python-docs...mageFormat
and pass that to PIL

Quote:getImageFormat() --returns format of captured image: 'BGRA' or 'RGBA'.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Oh, thank you; my issue is solved thanks to your suggestion.

For anyone who's experiencing the same problem, I've solved it with PIL as follows:

Code:
# presumes you have stored capture data in variable "capture" and image size in the tuple "size"
img = Image.frombuffer("RGBA", size, capture, "raw", "RGBA", 0, 1)
corrected_image = Image.frombytes("RGBA", img.size, img.tostring(), "raw", "BGRA")
# Now you can corrected_image.save() etcetera

You can't do it directly, as PIL does not accept BGRA-mode when reading from buffer.
Reply

Logout Mark Read Team Forum Stats Members Help
Colour differences between RenderCapture output and actual video0