Open-EO / openeo-earthengine-driver

openEO back-end driver for Google Earth Engine.
Apache License 2.0
21 stars 7 forks source link

save_result png wrong colors - set BRG instead of RGb #44

Closed clausmichele closed 4 years ago

clausmichele commented 4 years ago

After some tests I've noticed that the stored PNG has wrong colors. To have the correct color mapping set: red = blue green = red blue = green

So the function saving pngs is expecting an image with BRG order instead of RGB.

m-mohr commented 4 years ago

It's actually GEE that is storing the PNG.

I'm passing [parameters.red, parameters.green, parameters.blue] to GEE's visualize function, which seems correct according to the GEE docs: https://developers.google.com/earth-engine/image_visualization

Are you sure? I can't really imagine GEE is really doing wrong things in this popular function?! I'd rather think it's wrong in my implementation, but I can't find any issue.

Also, this process graph seems to work just fine:

{
  "process_graph": {
    "1": {
      "process_id": "load_collection",
      "arguments": {
        "id": "USDA/NAIP/DOQQ",
        "spatial_extent": {
          "west": -76.74021005630493,
          "south": 39.956530315364915,
          "east": -76.71158552169801,
          "north": 39.96843762340802
        },
        "temporal_extent": [
          "2017-01-01T00:00:00Z",
          "2017-12-31T23:59:59Z"
        ],
        "bands": null
      }
    },
    "2": {
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "1"
        },
        "format": "PNG",
        "options": {
          "red": "R",
          "green": "G",
          "blue": "B",
          "gray": null
        }
      },
      "result": true
    }
  }
}

which gives: image

Your mapping leads to: image

So I need a reproduction example, otherwise I can't help you. Will re-open once there's a repro available.

clausmichele commented 4 years ago

Sorry my mistake, I had an error in my process graph! I re-checked and it is indeed right.