octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.4k stars 970 forks source link

Returned image buffer has Red and Blue channels swapped [b, g, r, a] #739

Open Ober3550 opened 1 year ago

Ober3550 commented 1 year ago

Expected Behavior

Image buffer should be in the format [r, g, b, a]

Current Behavior

Image buffer is in the format [b, g, r, a]

Possible Solution

Change how the internals read the buffer or flip the channels before returning to user

Context

When using this library with other modules like sharp it's expected that raw formats are [r, g, b] or [r, g, b, a]. This weird color channel setup makes it annoying to use with other image manipulation tools.

JijaProGamer commented 6 months ago

Images are in bgra because thats the preffered format for 99.999% of GPUs, so when they take the frame buffer, they keep the format.