glue-viz / glue-geospatial

Experimental plugin to support satellite imagery
BSD 3-Clause "New" or "Revised" License
13 stars 3 forks source link

Can you stretch in multiple RGB channels at the same time? #9

Open robintw opened 8 years ago

robintw commented 8 years ago

When displaying an image as RGB there is a set of radio buttons labelled 'Contrast', presumably to choose which channel to do the contrast stretch on.

Is there a way to do a contrast stretch on all of the RGB channels? When I choose a different channel and stretch on that, it seems to undo previous stretches.

The reason this is important is that satellite images are usually displayed with a contrast stretch in all three displayed channels (RGB). The default contrast stretch is also usually 98%, which isn't actually in the list of standard contrast stretches - but I've put that in a separate issue (#10)

(By the way, I'm using the logic of 'raise an issue for everything that caused me an issue when experimenting this evening' - I'm not trying to pester you into changing things, or even saying that all of these things even need fixing)

astrofrog commented 8 years ago

(By the way, I'm using the logic of 'raise an issue for everything that caused me an issue when experimenting this evening' - I'm not trying to pester you into changing things, or even saying that all of these things even need fixing)

This is great - best way to make sure we keep track of these things!

Is there a way to do a contrast stretch on all of the RGB channels? When I choose a different channel and stretch on that, it seems to undo previous stretches.

There isn't, but that would be a nice feature to add :)

robintw commented 8 years ago

I agree this would be a good feature to add. I've had a look at the code, and to be honest it looks a bit too complicated for me at the moment: there seem to be multiple different levels at which RGB stretching is dealt with (eg. RGBImageLayerArtist, RGBEdit) and choosing an individual band to stretch on seems to be baked into the code at quite a low level.

I'd say this was a fairly important feature for satellite imaging, but I think I'll leave it for the moment. If you've got any specific ideas on how best to approach this then I may be able to try and hack something together.

astrofrog commented 8 years ago

@robintw - I'm planning on completely refactoring the code for the viewers which is indeed far too complex for what it does at the moment, so maybe it makes sense to punt on this until I've had a chance to do this? (and maybe I can even implement it as part of the refactoring). I should have time to work on it next week.

I will check if there is an easy fix in the mean time though.

robintw commented 8 years ago

Perfect - a refactor here would be great, and there's no immediate rush for the stretching (at the moment the majority of the images on my current project are single-band)