Skip to content

CLI: PNG export does not use background color

Summary:

Inkscape versions prior to 1.3 used the page color (with opacity taken into account) as the background-color for PNG exports. After inkscape!4120 (merged), this is no longer the case. The gui export uses inkscape:export-bgcolor to set background, but the CLI export does not. For backward compatibility, we could perhaps check if it is possible to use the page-color for export-bgcolor if the page-color opacity is non-zero.

Steps to reproduce:

  • Save test-export-bgcolor-cli.svg
  • Open Inkscape and export page via GUI
  • run inkscape-dev --export-area-page --export-filename=test-bgcolor-export.png test-export-bgcolor-cli.svg

What happened?

Exporting via CLI produced image with transparent background - GUI export had colored background.

What should have happened?

CLI export should have had colored background.

Version info

Inkscape 1.3-alpha (ebb421a2d7, 2023-05-08, custom)

    GLib version:     2.76.2
    GTK version:      3.24.37
    glibmm version:   2.66.5
    gtkmm version:    3.24.7
    libxml2 version:  2.10.4
    libxslt version:  1.1.37
    Cairo version:    1.17.8
    Pango version:    1.50.14
    HarfBuzz version: 7.1.0

    OS version:       Fedora Linux 38 (Workstation Edition)
Edited by KrIr17
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information