Skip to content

Transparency from browserWindow.capturePage is lost after calling nativeImage.resize #12308

Closed

Description

@countravioli
  • Electron version: 2.0.0beta3 & 1.8.3
  • Operating system: OSX & Windows 10 64bit

Expected behavior

Resizing a nativeImage that is a product of calling BrowserWindow.capturePage should maintain transparency in all cases, not just when hardware acceleration is disabled

Actual behavior

Resizing a nativeImage that is a product of calling BrowserWindow.capturePage converts tranparent pixels to black. If you instantiate your app disabling the gpu / hardware acceleration (app.disableHardwareAcceleration) it works as one would expect.

How to reproduce

git clone https://github.com/countravioli/electron-native-image-resize-transparency-bug
cd electron-native-image-resize-transparency-bug
npm install
npm start
npm run start-works

npm start - will run the app normally, illustrating the bug. Two images are written in the directory at the same level as app.js (original.png and resized.png)
npm run start-works - will run the app with disableHardwareAcceleration showing things work. The same to pngs are created.

The app will quit when its done. If you are on mac the pngs will open in your default application associated with the file type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions