16EAGLE / basemaps

A lightweight package for accessing basemaps from open sources in R 🗺️
https://jakob.schwalb-willmann.de/basemaps
GNU General Public License v3.0
57 stars 15 forks source link

plotRGB throws color intensity bug #25

Closed jebyrnes closed 5 months ago

jebyrnes commented 8 months ago

Working on a piece where

plotRGB(landsat_colors_1230,
        r = 3, g = 2, b = 1)

throws the error

Error in grDevices::rgb(RGB[, 1], RGB[, 2], RGB[, 3], alpha = out$alpha,  : 
  color intensity 1.00153, not in [0,1]

But if I rescale it by the max value of those three channels

plotRGB(landsat_colors_1230 * 255/51097,
        r = 3, g = 2, b = 1)

everything is fine. Not sure what's going on here.

16EAGLE commented 6 months ago

Thanks for reporting that bug. I cannot reproduce it with your example. In case you have a minimal reproducible example, please provide it.