Fire not showing in saved PNG #96200

Closed
opened 2022-03-06 16:58:54 +01:00 by Andreas Becker · 16 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 780/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.98

Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-04 16:11, hash: 295d5c6ef5

  • Also broken with 3.1 RC (downloaded 2022-03-06) and 3.0.1 Release
    Worked: Unknown

Short description of error
When rendering a smoke/fire simulation, the fire shows in Blender's image editor after rendering, but not in the saved image.
In this example screenshot, you can see the render result in Blender's image editor (on the left) and the saved image (on the right), opened with my default image viewer. I also tried another image viewer as well as GIMP, which both showed the same result, just like the Windows image preview. The grey background in the image viewer (as opposed to checkerboard) is the viewer's background color, not the actual color of the image, which is instead transparent.
Bug.jpg

Exact steps for others to reproduce the error

  1. Open Blender (default settings, right after downloading)
  2. Set render engine to Cycles
  3. Enable Film > Transparent (bug doesn't happen with this option disabled)
  4. Add "Quick Smoke" effect to the default cube
  5. Set the flow type of the cube to "Fire" (bug doesn't happen with "Smoke" or "Fire + Smoke")
  6. In the material of the smoke domain, add an attribute node, set it to "flame", and connect its "Fac" output to the "Blackbody Intensity" input of the Principled Volume node (so the fire actually shows up in render)
  7. Render frame 1, where the fire is clearly visible in the image editor inside Blender (bug also happens after ESC-ing the rendering process before it finishes)
  8. Go to "Image" > "Save Image As..." and save the image in PNG file format and with RGBA color channels (fire is shown as intended when saving in JPG format, which doesn't support transparency)
  9. Open the saved image, where the fire is not visible (but its light on the cube is visible)

Thank you to all developers for your work on Blender, I really love this software!

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 780/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.98 **Blender Version** Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-04 16:11, hash: `295d5c6ef5` - Also broken with 3.1 RC (downloaded 2022-03-06) and 3.0.1 Release Worked: Unknown **Short description of error** When rendering a smoke/fire simulation, the fire shows in Blender's image editor after rendering, but not in the saved image. In this example screenshot, you can see the render result in Blender's image editor (on the left) and the saved image (on the right), opened with my default image viewer. I also tried another image viewer as well as GIMP, which both showed the same result, just like the Windows image preview. The grey background in the image viewer (as opposed to checkerboard) is the viewer's background color, not the actual color of the image, which is instead transparent. ![Bug.jpg](https://archive.blender.org/developer/F12899590/Bug.jpg) **Exact steps for others to reproduce the error** 1. Open Blender (default settings, right after downloading) 2. Set render engine to Cycles 3. Enable Film > Transparent (bug doesn't happen with this option disabled) 4. Add "Quick Smoke" effect to the default cube 5. Set the flow type of the cube to "Fire" (bug doesn't happen with "Smoke" or "Fire + Smoke") 6. In the material of the smoke domain, add an attribute node, set it to "flame", and connect its "Fac" output to the "Blackbody Intensity" input of the Principled Volume node (so the fire actually shows up in render) 7. Render frame 1, where the fire is clearly visible in the image editor inside Blender (bug also happens after ESC-ing the rendering process before it finishes) 8. Go to "Image" > "Save Image As..." and save the image in PNG file format and with RGBA color channels (fire is shown as intended when saving in JPG format, which doesn't support transparency) 9. Open the saved image, where the fire is not visible (but its light on the cube is visible) Thank you to all developers for your work on Blender, I really love this software!
Author

Added subscriber: @AndreasBecker

Added subscriber: @AndreasBecker
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

I can't replicate this issue. Attached is the output PNG image I get and the file that follows your instructions. Does this image and file have the same issue you described? If not, can you attach the image and file you got?

fire.png

fireTransparent.blend

I can't replicate this issue. Attached is the output PNG image I get and the file that follows your instructions. Does this image and file have the same issue you described? If not, can you attach the image and file you got? ![fire.png](https://archive.blender.org/developer/F12900295/fire.png) [fireTransparent.blend](https://archive.blender.org/developer/F12900294/fireTransparent.blend)
Author

Hi Omar,

for me, your file has the same issue I described in my original post.

I attached your file again after saving it on my system, maybe there is some difference between the two versions (your upload and mine) that causes this issue.

I'll also try to replicate this on my old laptop later. That laptop runs on Linux Mint and has an integrated GPU, so it shouldn't be quite different in that sense.
Edit: I tried on my Linux laptop now with Omar's file, but it also gave me the same result: It shows the fire as expected inside Blender after rendering, but when I save and open the image, the fire is gone.
Edit2: On my laptop, I have Blender 3.0.0 installed. It runs Linux Mint 20.3 Cinnamon and has an Intel Core i5 2430M with integrated graphics controller.

fireTransparent.blend

Hi Omar, for me, your file has the same issue I described in my original post. I attached your file again after saving it on my system, maybe there is some difference between the two versions (your upload and mine) that causes this issue. I'll also try to replicate this on my old laptop later. That laptop runs on Linux Mint and has an integrated GPU, so it shouldn't be quite different in that sense. Edit: I tried on my Linux laptop now with Omar's file, but it also gave me the same result: It shows the fire as expected inside Blender after rendering, but when I save and open the image, the fire is gone. Edit2: On my laptop, I have Blender 3.0.0 installed. It runs Linux Mint 20.3 Cinnamon and has an Intel Core i5 2430M with integrated graphics controller. [fireTransparent.blend](https://archive.blender.org/developer/F12900944/fireTransparent.blend)
Member

Are you sure it is just not related to how the application you use to view the image is handling alpha? Some applications don't handle different cases of alpha like premultiplication well. Does the image I attached above get viewed correctly for you or is it just the same?

Are you sure it is just not related to how the application you use to view the image is handling alpha? Some applications don't handle different cases of alpha like premultiplication well. Does the image I attached above get viewed correctly for you or is it just the same?
Author

Here is a screenshot of my saved render (left) vs. your image from above, both opened in the same application. As you can see, the cube in my render has sharp edges, whereas in your image, the fire shows up correctly.

image.png

Here is my render, just to check if that is displayed correctly for you.

untitled.png

And here is a full resolution screenshot of that same render in my viewer application

image.png

There seems to be a very faint hint of the fire in the image, but it's far less than in Blender.

Here is a screenshot of my saved render (left) vs. your image from above, both opened in the same application. As you can see, the cube in my render has sharp edges, whereas in your image, the fire shows up correctly. ![image.png](https://archive.blender.org/developer/F12902243/image.png) Here is my render, just to check if that is displayed correctly for you. ![untitled.png](https://archive.blender.org/developer/F12902490/untitled.png) And here is a full resolution screenshot of that same render in my viewer application ![image.png](https://archive.blender.org/developer/F12902493/image.png) There seems to be a very faint hint of the fire in the image, but it's far less than in Blender.
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

Added subscriber: @Ethan-Hall

Added subscriber: @Ethan-Hall

It may be related to: https://developer.blender.org/T81199

It may be related to: https://developer.blender.org/T81199

It seems like the image viewer and compositor perform some tone mapping that causes bright transparent values to contribute to the alpha. However, the alpha channel is not modified when saving the image. The same problem happens when using bloom and transparency, particularly when using EEVEE's bloom.

Note that you can save the render as an EXR. Then, when you load the image back into Blender, Blender will reintroduce the tone mapping to the alpha channel and you can use the image in the compositor as expected. Then if you save the composite without alpha, there will not be a discrepancy between Blender's internal image viewer and an external image viewer.

image.png

Also, node that if you enable Convert Premultiplied, the alpha is not effected in the same way.

image.png

It seems like the image viewer and compositor perform some tone mapping that causes bright transparent values to contribute to the alpha. However, the alpha channel is not modified when saving the image. The same problem happens when using bloom and transparency, particularly when using EEVEE's bloom. Note that you can save the render as an EXR. Then, when you load the image back into Blender, Blender will reintroduce the tone mapping to the alpha channel and you can use the image in the compositor as expected. Then if you save the composite without alpha, there will not be a discrepancy between Blender's internal image viewer and an external image viewer. ![image.png](https://archive.blender.org/developer/F12902573/image.png) Also, node that if you enable `Convert Premultiplied`, the alpha is not effected in the same way. ![image.png](https://archive.blender.org/developer/F12902588/image.png)

Added subscriber: @mano-wii

Added subscriber: @mano-wii

It's the same problem described in #81199 (Some effects [bloom, smoke, fire, ..] still don't save in PNG with transparent background (occlusion vs. emission)).
Basically, Alpha + Emission + PGN don't get along well together.
That's because an emission like fire, although visible, can still have alpha 0.0, and PNG sees this as invisible.
Maybe the PNG codec needs to be edited to do a correct emission + alpha conversion.

It's the same problem described in #81199 (Some effects [bloom, smoke, fire, ..] still don't save in PNG with transparent background (occlusion vs. emission)). Basically, Alpha + Emission + PGN don't get along well together. That's because an emission like fire, although visible, can still have alpha 0.0, and PNG sees this as invisible. Maybe the PNG codec needs to be edited to do a correct emission + alpha conversion.

Closed as duplicate of #81199

Closed as duplicate of #81199

@mano-wii I would like to see two additional checkbox options for the PNG RGBA format.

  1. Clean Alpha: Set RGB pixels to black if the pixel is fully transparent.
  2. Modify Alpha: Modify the alpha channel to correctly represent the image when used as a straight alpha.
@mano-wii I would like to see two additional checkbox options for the PNG RGBA format. 1) Clean Alpha: Set RGB pixels to black if the pixel is fully transparent. 2) Modify Alpha: Modify the alpha channel to correctly represent the image when used as a straight alpha.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#96200
No description provided.