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

Trouble with 16 bit geryscale image #601

Open
CYANUTXie opened this issue May 12, 2023 · 1 comment
Open

Trouble with 16 bit geryscale image #601

CYANUTXie opened this issue May 12, 2023 · 1 comment

Comments

@CYANUTXie
Copy link

Hi. I cannot open 16 bit geryscale image. They are in .png format. Any suggestions?

@SixK
Copy link

SixK commented May 16, 2023

1 explication could be your greyscale images are not RGB (a classical situation with greyscale images).
on Linux, check file format using "file image.png", it should return something like that "PNG image data, 800 x 600, 8-bit/color RGB, non-interlaced"

Maybe you could try to convert your images to RGB format.
You can try converting a single image like this (on linux using ImageMagick) :
convert image.png -define png:color-type=2 result.png
or convert input.png -type TrueColor png24:output.png

To modify a complete directory (careful, it's an inplace operation, backup your grayscale images before)
mogrify -define png:format=png24 -type TrueColor *.png

Note that if training a generic model, then you may have the same problem if you want to use grayscale images.
You can annotate your images converted to RGB and train with greyscale also, but be sure your model can handle them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants