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
Color space and saving issues with JPEG Baseline (Process 1) #1781
Comments
Hopefully others will comment, color conversion is not an area of expertise for me, but it is possibly a bug in pydicom: |
This may not be obvious from the documentation, but I'm not sure if and how we want to change this behavior, but it probably deserves at least a clearer documentation. |
Describe the bug
I'm not sure what of any of this is a bug, but I have a sample file that is JPEG encoded, and I'm having issues converting the color space and saving after
decompress
ingSteps To Reproduce
I wrote a simple script to visualize the issues I'm having with this jpeg US dicom
When I load the image, decompress using pylibjpeg and plot the image, the color is in YBR, which is fine, but I tried (1) saving the image and reloading and it gets distorted, and (2) converting the color space to RGB and saving (I did remember to update the PhotometricInterpretation), and that also gets distorted (see figure below).
My question is, am I using this wrong? I would at least expect decompressing, saving, and reloading to give the same results.
This script prints the following warning as well:
Expected behavior
Given the following figure, I expect the first to look like it does, the second to look like the first, and the third to have the correct colors.
Your environment
Edit: Added the warning
The text was updated successfully, but these errors were encountered: