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
VSI->TIF converted images with JPEG compression throws errors in GIMP #3372
Comments
Confirmed: Using Bio-Formats 6.0.1 and one of our own sample files:
|
I was playing around more with my weird image color problem on #3462 and it appears that it's a cymk/rgb color model issue. If I read the weird colored image (and assume it's cymk as opposed to rgb - not sure as the bytes were retrieve from a VSI file using bioformats) and convert it to RGB, it looks fine. ImageIO throws errors when trying to read cymk images and apparently ImageIO is only able to deal with RGB, not CYMK. On digging through the code, I found that ome.codecs.JPEGCodec uses IOImage on writes. I'm still fishing around in the code but I thought I would share the CYMK/RGB revelation as it partly solves my problem. |
Thanks for the continued investigation @ebremer. We have begun digging into it on our side too and it certainly sounds like the CYMK/RGB revelation may well be important here. |
I'm having this problem as well. I tested it on a set of [.ndpi, ventana .tif, aperio .tif, .czi]. Of those, all four successfully converted with LZW compression. With JPEG, the ventana and aperio .tifs both succeeded, while the .czi and .ndpi failed. |
Hi @markemus, did they fail during the conversion or was it only once you tried to open the converted images after that you noticed? Do you have the specific error messages or stack trace? |
I'm calling the command line from python 3.6. The error occurs after the bioformats conversion completes, apparently successfully. I'm calling tiffcp on the output file after the bioformats conversion has completed in order to create a tif with a contiguous planar configuration (bioformats uses "separate" planar configuration). Stack trace for the czi:
The command for bioformats was:
(Side note: the "-8" flag enables bigtiff for tiffcp, but is undocumented) |
This issue came back to haunt me. Trying to save TIFF images with Bioformats 6.6.1. When I try to read the images with Gimp 2.10.24 rev 3, it throws this error and the resultant loaded image is all black. |
Thanks @ebremer, I will need to do some deeper investigation into this, I do believe it is due to using ImageIO with CYMK data, so it may be that we either need to find an alternative or try to detect this and perform some conversion to RGB steps beforehand. |
My data in this case isn't CYML, but RGB. |
Ok, that sounds like we have a more widespread problem with the JPEG compression. |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/bfconvert-specifying-chunky-or-planar/56059/4 |
The various software (like GIMP) and other software I am using that throw this error, trace back to libtiff to these lines of code: |
Okay, I got this to work.
|
Trying to view a VSI->TIF converted image with JPEG compression in GIMP throws the following error over and over:
Improper JPEG sampling factors 2,2
Apparently should be 1,1.
The text was updated successfully, but these errors were encountered: