Skip to content

Partial transparency blended with black in screenshot images saved using get_viewport().get_texture().get_image().save_png() #113103

@mellowminx

Description

@mellowminx

Tested versions

System information

Godot v4.5.stable - macOS Sequoia (15.7.1) - Multi-window, 1 monitor - OpenGL 3 (Compatibility) - Apple M1 Pro - Apple M1 Pro (10 threads) - 16.00 GiB memory

Issue description

When using Godot's get_viewport().get_texture().get_image().save_png() function to save screenshot images of a game with partially transparent visuals (such as gradients which fade to transparent), using a transparent background window, the partially transparent pixels are blended with black, resulting in a darker (and uglier)

Image

Steps to reproduce

  1. Display a Sprite2D that has partial transparency (such as a gradient which fades to transparent)
  2. Make sure background transparency settings are on (as in MRP)
  3. Take a screenshot using get_viewport().get_texture().get_image().save_png()

Minimal reproduction project (MRP)

MRP uploaded here: https://github.com/mellowminx/godot-4-5-transparent-bg-screenshot-test/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions