Maniphest T60221

TIFF 8bit always saved and loaded as unassociated alpha
Confirmed, LowKNOWN ISSUE

Assigned To
None
Authored By
Troy Sobotka (sobotka)
Jan 6 2019, 1:45 AM
Tags
  • BF Blender
  • Images & Movies
  • VFX & Video
  • Core
Subscribers
Brecht Van Lommel (brecht)
Troy Sobotka (sobotka)

Description

Operating system: Linux amd64 Debian Buster
Graphics card: NA

Broken: All
Worked: Possibly way back.

Blender can handle own TIFFs

TIFF handling in Blender has been forever been broken for a number of reasons.

By default TIFFs encode associated alpha. Sadly, Blender had a hack that tried to "preserve" background pixels, coupled with saving with extrasamples set to unassociated alpha. The result is that Blender can't properly load it's own files.

Revisions and Commits

rB Blender
Abandoned

Event Timeline

Troy Sobotka (sobotka) created this task.Jan 6 2019, 1:45 AM
Troy Sobotka (sobotka) added a comment.Jan 6 2019, 1:53 AM

Fixed by D4175.

Troy Sobotka (sobotka) added a revision: D4175: TIFF encoding / decoding fix.Jan 6 2019, 2:51 AM
Brecht Van Lommel (brecht) lowered the priority of this task from 90 to 30.Jan 6 2019, 2:48 PM
Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).

Please provide exact steps to redo the problem. There are like a dozen possible combinations of settings here, and if we're not precise it's easy to fix one case but break another.

Troy Sobotka (sobotka) added a comment.Jan 6 2019, 9:02 PM
  1. Save an image with alpha from Blender, or attempt to find a image with unassociated alpha on the net. The latter will be virtually impossible as TIFFs by canonical default are associated.
  2. Load the file in Blender.

Result is broken.

In the following Blend file, the first is a legitimate associated alpha TIFF. Blender, due to goofy alpha handling at 8 bit, decides to unassociate the alpha as per convention for all 8 bit formats. When saving a direct copy of the image as a TIFF, the result is broken. Sample Blend file F6202617.

Brecht Van Lommel (brecht) added a comment.EditedJan 6 2019, 9:56 PM

As far as I can tell the issue can be summarized as: if you use 8 bit TIF images as digital intermediates, then saving and loading these will go through a lossy associated -> unassociated -> associated conversion, because Blender always saves 8 bit files unassociated. When using 16 bit TIF images there is no such issue, as they are saved with associated alpha.

This seems like more of a theoretical issue since 8 bit is not appropriate for digital intermediates, but it could be fixed.

Troy Sobotka (sobotka) added a comment.EditedJan 6 2019, 10:56 PM

I believe it is more than a round trip quantisation issue.

From what I can tell, saving directly from an input node mangles the alpha in the resultant image. The encoded values are unrecoverable. I think the issue is the hack, but I may be incorrect.

I believe you are quite correct in that the diff ends up doing the opposite. The difference is that the encoded file values are recoverable.

Troy Sobotka (sobotka) added a comment.EditedJan 6 2019, 10:58 PM

I’d add that if the baseline in all of Blender were associated, the many, many, many non trivial alpha errors, including the flip flop issue you cited, would be solved. You’d never be going unassociated from associated at 8 bit, as it is nonsensical.

Philipp Oeser (lichtwerk) raised the priority of this task from 30 to Normal.Jan 15 2019, 1:16 PM
Brecht Van Lommel (brecht) renamed this task from TIFF HANDLING: Completely broken with files generated from within Blender to TIFF 8bit always saved and loaded as unassociated alpha.Jan 28 2019, 1:32 PM
Brecht Van Lommel (brecht) triaged this task as Low priority.
Sam Van Hulle (sam_vh) mentioned this in T68926: Color Management Improvements.Sep 5 2019, 2:39 PM
Dalai Felinto (dfelinto) added a project: Tracker Curfew.Dec 23 2019, 4:35 PM
Richard Antalik (ISS) edited projects, added Images & Movies; removed Tracker Curfew.Jan 22 2020, 6:39 PM
Richard Antalik (ISS) changed the subtype of this task from "Report" to "Known Issue".
Bastien Montagne (mont29) added a project: VFX & Video.May 22 2020, 10:11 AM
Sergey Sharybin (sergey) moved this task from Backlog to Known Issues on the VFX & Video board.Jun 12 2020, 4:03 PM
Evan Wilson (EAW) moved this task from Backlog to Known Issue on the Images & Movies board.Jan 5 2022, 7:26 AM
Bastien Montagne (mont29) added a project: Core.Jan 25 2022, 11:21 AM
Bastien Montagne (mont29) moved this task from Backlog to Known Issues on the Core board.Jan 25 2022, 12:39 PM