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

Loading 16-bit tiff images #2987

Open
marcelschilling opened this issue Mar 21, 2021 · 7 comments
Open

Loading 16-bit tiff images #2987

marcelschilling opened this issue Mar 21, 2021 · 7 comments
Labels
bug Something isn't working need info Need more information to investigate the issue

Comments

@marcelschilling
Copy link

Hello, I tried to load tiff images using the online test version of cvat. However, it always failed when trying to upload a tif image. Uploading jpg or png was possible. Is tiff data format not supported? Thanks in advance. Best, Marcel

@azhavoro
Copy link
Contributor

Hi, I just successfully created a task with a tiff image, could you please share any image you tried to upload? Perhaps your images are using some type of compression or something else that is not supported.

@marcelschilling
Copy link
Author

Hi, thank you very much for your response. It tried it with another image (8 bit tiff rgb image) and it worked for me, too. However, using a 16 bit tiff image won't work. Maybe there is a issue/no compatibility to use 16 bit tiff images (maybe pil related)?

@azhavoro azhavoro added the bug Something isn't working label Mar 30, 2021
@azhavoro azhavoro added this to the Backlog milestone Mar 30, 2021
@nmanovic nmanovic changed the title Loading tiff images Loading 16-bit tiff images Apr 15, 2021
@azhavoro
Copy link
Contributor

@marcelschilling Hi,

unfortunately I cannot reproduce the issue with 16 bit depth image, could you please share any image that is not working for you? Thanks

I've tried with:

Format: TIFF (Tagged Image File Format)
  Mime type: image/tiff
  Class: DirectClass
  Geometry: 3072x2048+0+0
  Resolution: 72x72
  Print size: 42.6667x28.4444
  Units: PixelsPerInch
  Colorspace: sRGB
  Type: TrueColor
  Endianness: MSB
  Depth: 16-bit
  Channel depth:
    Red: 16-bit
    Green: 16-bit
    Blue: 16-bit

@azhavoro azhavoro added the need info Need more information to investigate the issue label Jun 28, 2021
@azhavoro
Copy link
Contributor

@marcelschilling I'll close the issue due to no response, please don't hesitate to reopen if the issue is still actual for you.

@gcamfer
Copy link

gcamfer commented Mar 11, 2022

I have the same issue.
I think the problem is when there is only one channel, EXIF info:

Filename - THM_00078_00070.tif
ImageWidth - 640
ImageLength - 512
BitsPerSample - 
Compression - 1 (None)
Make - senseFly
Model - senseFlyThermal
StripOffset - 3638
SamplesPerPixel - 1
StripByteCount - 655360
ExifOffset - 3478
DateTimeOriginal - 2014:10:23 10:33:49

GPS information: - 
GPSLatitudeRef - N
GPSLatitude - 46.535397  0  0 (46.535397)
GPSLongitudeRef - E
GPSLongitude - 6.55555  0  0 (6.555550)
GPSAltitude - 528.10 m

I download the images from sensefly web:
https://senseflycom.s3.amazonaws.com/datasets/thermomap-solarpanel/Geotagged%20images.rar

If necessary I will open another isue for this topic.
Thanks

@FeryET
Copy link

FeryET commented Jun 6, 2022

Hello. Is there any update on tif images?

@nmanovic nmanovic reopened this Dec 10, 2022
@nmanovic nmanovic removed this from the Backlog milestone Dec 10, 2022
nmanovic pushed a commit that referenced this issue Jan 11, 2023
Pull Request regarding Issue #2987 

PIL.Image conversion from I;16 to L or RGB are unsuccessful as for now.
See the corresponding Issue in the Pillow GitHub (Opened 2018, so no
changes to be expected)
python-pillow/Pillow#3011

The proposed changes at least fix this issue for the mode 'I;16' and
delivers a possible solution for other modes (eg. I;16B/L/N).

This results in a correct calculation of the preview thumbnail and the
actual image, the annotation will be performed on.

We have used this solution on our own dataset and created annotations
accordingly.
@KasimirOr
Copy link

KasimirOr commented May 25, 2023

Hello, I tried to upload geotiff images using the online version of cvat. I can upload the images as new tasks but they appear fully black (they are not!). When uploading a JPEG it works fine. Can you please help me with that? Might this be related to 4 bands of the images (RGB + NIR)?
Thanks a lot!

Best,
Kasimir

mikhail-treskin pushed a commit to retailnext/cvat that referenced this issue Jul 1, 2023
Pull Request regarding Issue cvat-ai#2987 

PIL.Image conversion from I;16 to L or RGB are unsuccessful as for now.
See the corresponding Issue in the Pillow GitHub (Opened 2018, so no
changes to be expected)
python-pillow/Pillow#3011

The proposed changes at least fix this issue for the mode 'I;16' and
delivers a possible solution for other modes (eg. I;16B/L/N).

This results in a correct calculation of the preview thumbnail and the
actual image, the annotation will be performed on.

We have used this solution on our own dataset and created annotations
accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need info Need more information to investigate the issue
Projects
None yet
Development

No branches or pull requests

6 participants