Should be fairly easy to implement: get data for one specific color channel as double array. See https://www.klayout.de/forum/discussion/476/is-there-any-api-supporting-generating-bitmap-out-of-gds