Skip to content

half float support - #76

Closed
leventt wants to merge 1 commit into
dranjan:masterfrom
leventt:master
Closed

half float support#76
leventt wants to merge 1 commit into
dranjan:masterfrom
leventt:master

Conversation

@leventt

@leventt leventt commented Dec 12, 2023

Copy link
Copy Markdown

Some host applications with PLY file support such as Agisoft Metashape produce half float color (when used with half float image formats such as EXR files).


📚 Documentation preview 📚: https://python-plyfile--76.org.readthedocs.build/en/76/

@dranjan
dranjan self-requested a review December 12, 2023 18:59
@dranjan dranjan self-assigned this Dec 12, 2023
@dranjan

dranjan commented Dec 12, 2023

Copy link
Copy Markdown
Owner

Hey @leventt, thanks for the interest! The usual policy in this project is not to extend the PLY format, unless the extensions are already in wide use (https://python-plyfile.readthedocs.io/en/stable/developing.html#contribution-guidelines). I'm not 100% sure what to do in this case. It may be used in one other tool, but also that one tool appears to be proprietary, which inclines me less to interoperate with it. I'm happy to have a discussion about it, though.

@leventt

leventt commented Dec 12, 2023

Copy link
Copy Markdown
Author

@dranjan thanks for the quick response and I see your point. If the concern is how wide the use case is and if the host application may be open source, I believe COLMAP and OpenEXR projects are open source and they would also produce similar output in conjunction as another example. For the wideness of the use cases... Source of where the half floats come from is actually OpenEXR. It is pretty widely used in VFX & Animation with 16 bit floats.

Also worth mentioning, PLY files may become more and more popular with the advent and success of a method called 3D Gaussian Splatting. Currently the exchange format used by most open source implementations of it including the official repo, is PLY. Official implementation doesn't output 16 bit floats necessarily but I think it may become more and more popular that it does. Considering the domains that this method caters to (VFX and CG in general) have popular applications and exchange formats such as EXR with 16 bit float color representations.

@leventt

leventt commented Dec 13, 2023

Copy link
Copy Markdown
Author

@dranjan any objections after my last message?

@dranjan

dranjan commented Dec 13, 2023

Copy link
Copy Markdown
Owner

I see your points, but let me get back to you in a day or two.

@dranjan

dranjan commented Dec 16, 2023

Copy link
Copy Markdown
Owner

Ok, finally got around to this.

  • I briefly looked into OpenEXR and I'm not seeing any capability to output PLY files.
  • I briefly looked into COLMAP and although it does support PLY, it doesn't appear to use half-precision floating-point properties.
  • I also looked into a couple of other popular open-source packages that support PLY and they also don't support half-precision.
  • Finally, I checked the original implementation from the author of the format, which as far as I can see is still being maintained (https://faculty.cc.gatech.edu/~turk/ply.tar.gz) and it also still only supports the original property types as documented.

My honest opinion is that Metashape, if it is creating PLY files with half or float16 properties, is simply generating invalid files. I don't see a good reason for them not to simply up-cast to float, since that is well-supported everywhere and can exactly represent all half-precision values.

If the community consensus shifts, or if Greg Turk says this should be allowed, then it becomes a different conversation, but as it is, I don't think it's plyfile's place to extend the format in this way.

@leventt

leventt commented Dec 16, 2023 via email

Copy link
Copy Markdown
Author

@dranjan

dranjan commented Dec 17, 2023

Copy link
Copy Markdown
Owner

As always, we can re-evaluate the situation as circumstances change, but for now: closing.

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

Successfully merging this pull request may close these issues.

2 participants