Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YCbCr format confusion #1002

Closed
Tcll opened this issue Nov 10, 2014 · 6 comments

Comments

@Tcll
Copy link

commented Nov 10, 2014

so I'm trying to figure out how to convert this format to [R,G,B], and I'm finding alot of various conversions and things and I'm extremely confused on this one...

for one, PIL's format is apparently borked:
http://stackoverflow.com/questions/7041172/pils-colour-space-conversion-ycbcr-rgb
^ the dude switches to YUV

for two, I have no idea which YCbCr format is used in pillow:
http://www.equasys.de/colorconversion.html

I think I may just skip support on this format until there's better documentation available >_>
(I understand it returns 3 values, but of what ranges)

@wiredfool

This comment has been minimized.

Copy link
Member

commented Nov 10, 2014

Looks like all the YCbCr conversion code predates Pillow. We don't appear to have a test image that's natively in that colorspace, so any info I'd have would be from going through the code and docs.

@homm

This comment has been minimized.

Copy link
Member

commented Dec 7, 2014

for one, PIL's format is apparently borked

I think Mark Ransom from SO gave exhaustive answer: It not broken, it follows JPEG YCbCr definition.

We don't appear to have a test image that's natively in that colorspace.

Every JPEG in YCbCr natively and transformed to RGB while opening. You can open JPEG without transforming by draft():

i = Image.open('small.jpg')
i.draft('YCbCr', None)
i.load()

But again, this will be JPEG definition of YCbCr, not ITU-R BT.601.

@Tcll

This comment has been minimized.

Copy link
Author

commented Dec 7, 2014

ah ok thanks, might wanna edit the doc and make that a little more known and easier to find out. ;)

if you like, anything I run across regarding confusion on this I can:
1: post them here (for the reason of buildup on "other similar issues")
2: supply this issue there and help make your response known

@hugovk

This comment has been minimized.

Copy link
Member

commented Dec 28, 2014

@Tcll Would you like to submit a PR to update the docs?

The generated docs: http://pillow.readthedocs.org/
are all under: https://github.com/python-pillow/Pillow/tree/master/docs
or just click the " Edit on GitHub" link at the top right of the RTD pages.

@Shoeboxam

This comment has been minimized.

Copy link

commented Jan 3, 2017

This issue appears to have been resolved, but was never closed.

@aclark4life aclark4life closed this Jan 3, 2017

@aclark4life

This comment has been minimized.

Copy link
Member

commented Jan 3, 2017

Thanks @Shoeboxam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.