Author Topic: True Colors  (Read 24925 times)

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: True Colors
« Reply #15 on: 2010 February 26 06:12:11 »
Hi Georg,

I finally had a brief opportunity to play with your data.

I can certainly see that a Histo transform of the V-channel (of an HSV extraction/combination) produced an image with 'more colour' than the identical transform applied to the L-channel of an L*ab extraction/recombination.

However, the HSV-processed image was FAR, FAR, FAR 'noisier' than I would have been prepared to accept.

But, interestingly, I then did an HSV-combine using the Histo-stretched L-channel data in place of the extracted V-channel. This actually gave a more 'pleasing' result - with the best of both worlds.

However, NONE of these attempts came ANYWHERE CLOSE to a simple RGB/K** Curve stretch, followed by an even simpler Curve Saturation (single-point) stretch.
(** or was it Lu?, I can't remember, and I am not at that PC to confirm anything at the moment)

It took less than 10% of the time (and effort) to achieve a perfectly acceptable result, using Curves, than it did with any of the other methods that I tried. And, I am sure that a second iteration of the same two, very gentle, Curve actions would have been just as worthwhile.

To me the Histo curve has its fundamental use to find the 'zero-clip' Black and White points for an image (RGB or Greyscale), and to impart an initial, GENTLE, mid-tone transfer function (MTF) to de-linearise the data before starting to work with HDRW, etc. Similarly, a final Histo adjustment, at the end of processing, can just help determine that the Black, White and MTF points are still in their best positions.

I know I used to flip back and forth between Histo and Curves, chasing the PhotoShop dragon endlessly - to no avail. Now I don't bother. I trust my usual procedures to do what I want them to do, and I just occasionally check the Histo points to make sure that I am using all the dynamic range available to the image.

Just my two cents - and I will post the images and PSMs if you want to see - or maybe just the PSMs, you and anyone else can grab the source FITS image, and 'play' !

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Simon Hicks

  • PixInsight Old Hand
  • ****
  • Posts: 333
Re: True Colors
« Reply #16 on: 2010 February 26 06:48:24 »
Hi Guys,

I must admit I've found all this very complicated to follow...I can understand RGB....but that's about it! All these other colour spaces confuse the hell out of me. I only have three types of colour receptors in my eyes....so surely that's enough?

But I've been getting pleasing results from doing the following;

Firstly, processing the image all the way through as normal.

Then when its time for a colour saturation, I take a Luminance of the image, apply it to the original image as a mask, then apply the colour saturation through this mask. This means that the colour saturation is not applied to the dark parts of the image (this would cause unwanted chromatic noise), and progressively applied more strongly as the brightness increases. Its usually the brighter parts that loose their colour, and these parts have the least noise, so they need (and can take) higher saturation. The mask gives you that selectivity.

You can muck about with the histogram of the mask image to tune the effect you are looking for.

I wonder if this is similar to applying the colour saturation by using curves? I might be doing the same thing but by a different route?

Cheers
         Simon

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: True Colors
« Reply #17 on: 2010 February 26 06:58:28 »
Similar Simon,

Start with an L-channel extract, and tweak it with a harsh Histo - to eliminate (protect) the darkest areas. Consider also generating a StarMask itself - and then use ATRWT to eliminate the Residual layer so that you don't have any nebulosity in the StarMask. Now use PixMath to combine these two masks so that you are protecting the dimmest data, and protecting the stars. Now you can run a Saturation Curve, or a ColourSaturation process through this 'clever' mask - and you should end up only enhancing the nebulosity.

As usual, this is a 'thought experiment' - how well it works may depend on the suitability of the source image, and the viability of the protecting mask.

But, it is always something to try when it's raining outside  :'(

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Alexander

  • Newcomer
  • Posts: 9
Re: True Colors
« Reply #18 on: 2010 February 26 15:33:18 »
Well read alot of this thread discovered two things, Clinterty Observatories member Niall  is hiding in a dark room rewriting the( How Too Book of the Universe) :D,While im next door smiling at the fact that my Meade DSI is a Colour camera,Which Colour i dont know!! cause now my thoughts on this is THAT COLOUR IS A MATTER OF INTERPRETATION.the light gathered by CCD Cameras can be tweaked to please the owner of each type of camera ,The basic colours are there,More important is surely the detail captured  ;D and processed in PI for all to enjoy. ;D......

Alex 

Offline dhalliday

  • PixInsight Old Hand
  • ****
  • Posts: 307
    • on Flickr
Re: True Colors
« Reply #19 on: 2010 February 26 15:52:35 »
Alex
Hi there !
Welcome to the group..!

Yes N can be a bit dry... >:D
Could you tell us a bit more about yourself...?

Do you have some snaps we could see..?
Join a free service like Flickr,if not...
What scope,mount,location..?
Anything else we should know..?

Kidding (!!!) but do tell (a bit..)
And yes...color is subjective..I think the main complaint is not always getting enough of it...esp with mono camera's..
There is some balance between luminance signal,and color...which is NOT understood by me...
Do not let our hobby of mind games freak you out...
Color is lower down on my (extensive) list of worries...
Dave
« Last Edit: 2010 February 26 16:05:02 by dhalliday »
Dave Halliday
8" Newtonian/Vixen VC200L/ TV 101,etc etc
SSAG/EQ6
CGE Pro
SBIG ST2K,ST10XME

Offline Alexander

  • Newcomer
  • Posts: 9
Re: True Colors
« Reply #20 on: 2010 February 26 15:55:46 »
Hi Georg

Just noticed your images of Cirrus Nebula and it is nearly identical to my image i also had the to choose between colour in stars or nebulosity i choose the nebulosity, My camera is a DSI 11 Col http://www.meade4m.com/gallery/4M/Screen/G002080.jpg

Alex

Offline Alexander

  • Newcomer
  • Posts: 9
Re: True Colors
« Reply #21 on: 2010 February 26 16:22:04 »
Hi Dave
Been a member for sometime, rekindled Niall interest in Astronomy when i moved next door,You can fine a few images i have done in the gallery my name was (Esraguin)

Scope LXD75 Meade
Cameras   DSI 1 DSI 11
Software   Nebulosity Phd Guiding and of course PI

Pixinsight is great, dont understand it most of the time but learning curve has been brilliant.The real heavy stuff i leave to Niall.

Alex

Offline dhalliday

  • PixInsight Old Hand
  • ****
  • Posts: 307
    • on Flickr
Re: True Colors
« Reply #22 on: 2010 February 26 18:18:34 »
So you are Niall's neighbor...
Small world !!
Is it true he uses a spirit level when he cuts his lawn,..?? >:D
« Last Edit: 2010 February 26 18:46:43 by dhalliday »
Dave Halliday
8" Newtonian/Vixen VC200L/ TV 101,etc etc
SSAG/EQ6
CGE Pro
SBIG ST2K,ST10XME

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: True Colors
« Reply #23 on: 2010 February 27 03:20:40 »
Hi Niall,

...
I can certainly see that a Histo transform of the V-channel (of an HSV extraction/combination) produced an image with 'more colour' than the identical transform applied to the L-channel of an L*ab extraction/recombination.

However, the HSV-processed image was FAR, FAR, FAR 'noisier' than I would have been prepared to accept.

But, interestingly, I then did an HSV-combine using the Histo-stretched L-channel data in place of the extracted V-channel. This actually gave a more 'pleasing' result - with the best of both worlds.

However, NONE of these attempts came ANYWHERE CLOSE to a simple RGB/K** Curve stretch, followed by an even simpler Curve Saturation (single-point) stretch.
(** or was it Lu?, I can't remember, and I am not at that PC to confirm anything at the moment)
...

- Your observation that the result using the V-transform is noisier than with the traditional HistogramTransform/ColorSaturation sequence is interesting. Any idea why that is the case?

- Also interesting that you were happier with using the L channel in place of the V-Channel in a HSV recombine. I need to give that a try. Mathematically, it should also preserve the R:G:B ratios, but with a brightness that is closer to the human perception than the V channel.

- I have never been able to restore the subtle colors in the M42 core when doing the traditional HistogramTransform/ColorSaturation sequence. Could you share your result? I also tried the procedure on my synthetic test image (which you can download on http://cid-c56e60845cfa6790.skydrive.live.com/self.aspx/Pixinsight/test.fit (2.5 MBytes)). Its impossible to preserve decent color for both regions (see top row in the screenshot in my first post http://pixinsight.com/forum/index.php?topic=1689.msg9757#msg9757), unless you use masks etc. as suggested by Simon. If you manage to do it, I would be interested to see your procedure.

- I now know why V-Transform looses some color in the faint parts of the Cirrus nebula (http://pixinsight.com/forum/index.php?topic=1689.msg9977#msg9977) compared to Histogram transform. It is because of the different compression of R:G:B ratios in different parts of the transformation curve: Histogram transform "compresses" the R:G:B ratios in those parts where the slope of the transformation curve is lower than 45 degrees (bright parts), making them "whiter". And it boosts the R:G:B ratio where it has a steep slope (dark parts, i.e. the nebula), thus creating a more colorful impression for these.

To all: Thanks for all those useful ideas and comments!

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: True Colors
« Reply #24 on: 2010 February 27 10:17:09 »
So you are Niall's neighbor...
Small world !!
Is it true he uses a spirit level when he cuts his lawn,..?? >:D

C'mon Dave - you should know by now that I don't have time for the trivia of lawn-cutting, I am WAY too busy trying to understand how PI works  8)

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: True Colors
« Reply #25 on: 2010 March 13 09:14:48 »
Hello!

Here is another try with the V-transform, this time on a star cluster. Thanks to a single night of reasonably clear skys (very rare this winter), I had a shot at M44/Praesepe/Beehive Cluster. Here is a screenshot that shows the merits and problems of the V-Transform:

- top row (from left to right): a small section of the cluster (with STF), V channel (with STF), S, H channels (without STF) as generated by ChannelExtraction. A recombination of these produces the original (no surprise, really)...

- first column (except first row, top to bottom): V channel after application of HistogramTransform (without STF). Recombination of this transformed V-Channel with the original S, V channels. The result is a picture that nicely shows the colors of the stars. There is one problem though: the cores of the stars seem to be burned out. I believe the reason for this is the fact that those stars were close to saturation (RGB values around 0.95) in the original pictures, where the camera sensor of my Canon EOS 40D no longer is in the linear range. So in a way, the burned out appearance is what was really recorded by the camera.

- second column (except first row, top to bottom): original picture treated with same histogram transform as the V-channel (without STF). We see a hint of color. The second picture was given an addition ColorSaturation boost, with the goal to arrive at a similar color impression as with the V-Transform. This succeeds, without giving the burned out impression at the star cores. I loose some of the existing color close to the cores. Unfortunately, the HistogramTransform/ColorSaturation also boost the color noise that I have in the background (which is amplified because the background is in the region of the HistogramTransform with a high slope, thus increasing color differences between R,G and B).

So this has been learned: I need to give M44 another try, without stars going into saturation. HistogramTransform plus ColorSaturation does have its merits in this situation, not showing the burned out stars as much as the V-Transform , but also boosting color noise.

Have a nice weekend,
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: True Colors
« Reply #26 on: 2010 March 14 05:24:04 »
Hello,

my significant other made another interesting observation: The diffraction spikes in the HistogramTransform image seem to exhibit something like a rainbow effect, going from white to some redish/brown color (left part of screenshot). I first thought that was caused by the dispersive effects of diffraction. But dispersion usually happens in the direction perpendicular to a slit or grating, while here the color effect is parallel to spider support struts of the secondary mirror. So most likely this is not dispersion, but rather an effect cause by the HistogramTransform.

The effect appears to be much less pronounced with the V-Transform, as seen on the right hand side of the attached screen shot (I still like to attribute the color effect in the central part to the overexposure of this region, but I am not 100% sure...).

Any thoughts on this?

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: True Colors
« Reply #27 on: 2010 March 14 09:13:20 »
Hi,

and one final experiment: I created a small script (attached below) that creates a color bar with R:G:B rations of 4:2:1, but different absolute values. So you might think of it as the signal produced by stars of identical color, but different brightness or distance to earth. Now I wanted to see what happens when using different methods of compressing the brightness information.

This is what I get (from left to right and top to bottom). All images are without STF, the RGB/intensity/value/luminance stretch was done with the same HistogramTransform for all of them.

- first row (RGB): Original data. Histogram stretched version: I do not get the "original" color impression anywhere. The third picture got an additional ColorSaturation boost (factor 1.6): this restores some of the color. Lots of contrast though. There is clearly a region where the result is most colorful, which may be the cause of the rainbow impression I described in my previous post.

-second row (HSV): Hue, saturation and value extracts. Image 4 is the histogram-stretched V image. Image 5 is the recombination with the stretched V-image ("V-Transform"). I like the fact that much of the color is preserved, but I loose some contrast in the bright parts.

-third row (HSI): Same precedure using the HSI colorspace, stretching I. The result (image 5) shows nice colors in the central part, bright parts are simply white.

- fourth row (CIE LAB): Same procedure using the CIE LAB space, stretching L. The result (image 5) shows pale colors. The central region is gray, and color cannot be restored there using ColorSaturation transforms. 

So here is what I learned from these experiments: V-Transform is probably the procedure that preserves color best, but it looses some brightness contrast. RGB HistogramTransform+ColorSaturation preserves most of the contrast, but looses color in bright regions (which are changed to white tones). I guess the best procedure depends on the kind of information you want to preserve.

Comments?

Georg


Code: [Select]
#include <pjsr/ColorSpace.jsh>
#include <pjsr/SampleType.jsh>
#include <pjsr/UndoFlag.jsh>

function main() {
   var rows=30;
   var cols=300;
   var RGB=Array(1.0,0.5,0.25);
   var max=cols;

   var image = new Image(cols,rows,3,ColorSpace_RGB,32,SampleType_Real);
   for (var chan=0;chan<3;++chan){
      for (var col=0;col<cols;++col){
         var factor=Math.exp(-col/60);
         var value=RGB[chan]*factor;
         for (row=0;row<rows;++row){
            image.setSample(value,col,row,chan)
         }
      }
   }
   image.resetSelections();
   var wtmp = new ImageWindow( image.width, image.height, image.numberOfChannels,
                              image.bitsPerSample,image.sampleType == SampleType_Real,
                              image.isColor, "tmp" );
   var v = wtmp.mainView;
   v.beginProcess( UndoFlag_NoSwapFile );
   v.image.assign( image );
   v.endProcess();
   wtmp.show();

}

main();

Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: True Colors
« Reply #28 on: 2010 March 14 13:55:44 »
Hi Georg,

Basically, I think all the work that has gone in here really helps to confirm one thing - there is no 'one way' to do things. Different areas of any image will need to be treated with a different approach. Which is really the fundamental reasoning behind the likes of Ron Wodaski's 'Zone' approach.

So, perhaps some images will have to be judiciously 'masked' and different transforms may then be applied to the differing regions. How would that work with your 'colour bar' test? Could you perceive a selection of masks that would allow you to apply different methods to different 'zones'? Would that approach provide you with a better 'overall' result?

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: True Colors
« Reply #29 on: 2010 March 20 17:29:15 »
Hi,

here is another experiment I did. I wanted to find out how those transforms behave for different saturations. The attached pictures show this:
- top row (left to right): Color Palette (0.75 saturation), HistogramTransform
- second row (left to right): same as above, V-Transform result
- 3rd row (left to right): Color Palette (0.1 saturation), HistogramTransform, Saturation Boost (9.0)
- 4th row (left to right): same as above, V-Transform, Saturation Boost (9.0)

The results basically confirm that HistogramTransform is not very good a preserving color, even after saturation boosts. V-Transform does a better job (in both scenarios). Unexpected for me was the apparent modulation in color in the saturation boosted V-Transform result (bottom right): Especially the yellow and pink parts vanish in the darker regions. I have no idea why that is the case.

Below the script used to create the palettes.

Cheers,
Georg

Code: [Select]
#include <pjsr/ColorSpace.jsh>
#include <pjsr/SampleType.jsh>
#include <pjsr/UndoFlag.jsh>

//from http://www.tecgraf.puc-rio.br/~mgattass/color/HSVtoRGB.htm
function HSVtoRGB(h,s,v){

   var r,h,b;
   if ( s == 0 ) {
      r = v;
      g = v;
      b = v;
   }else{
      var var_h = h * 6;
      var var_i = Math.floor( var_h );
      var var_1 = v * ( 1 - s );
      var var_2 = v * ( 1 - s * ( var_h - var_i ) );
      var var_3 = v * ( 1 - s * ( 1 - ( var_h - var_i ) ) );
      if ( var_i == 0 ) { r = v; g = var_3 ; b = var_1; }
      else if ( var_i == 1 ) { r = var_2 ; g = v; b = var_1; }
      else if ( var_i == 2 ) { r = var_1 ; g = v; b = var_3; }
      else if ( var_i == 3 ) { r = var_1 ; g = var_2 ; b = v; }
      else if ( var_i == 4 ) { r = var_3 ; g = var_1 ; b = v; }
      else { r = v; g = var_1 ; b = var_2; }
   }
   return new Array(r,g,b);
}


function main() {
   var rows=150;
   var cols=300;
   var saturation=0.1; //0.75 or 0.1;
   var maxValue=1.0;

   var image = new Image(cols,rows,3,ColorSpace_RGB,32,SampleType_Real);
   for (var col=0;col<cols;++col){
      var factor=Math.exp(-col/60);
      var value=maxValue*factor;
      for (var row=0;row<rows;++row){
         var hue=row/rows;
         RGB=HSVtoRGB(hue,saturation,value);
         for (var chan=0;chan<3;++chan){
            image.setSample(RGB[chan],col,row,chan);
         }
      }
   }
   image.resetSelections();
   var wtmp = new ImageWindow( image.width, image.height, image.numberOfChannels,
                              image.bitsPerSample,image.sampleType == SampleType_Real,
                              image.isColor, "tmp" );
   var v = wtmp.mainView;
   v.beginProcess( UndoFlag_NoSwapFile );
   v.image.assign( image );
   v.endProcess();
   wtmp.show();

}

main();
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)