• Welcome to Orpington Astronomical Society.
 

News:

New version SMF 2.1.4 installed. You may need to clear cookies and login again...

Main Menu

Star colours - test image

Started by MarkS, Oct 24, 2012, 01:06:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarkS

OK - so it took longer than I expected to produce this test image - but I'm pleased with the result.

You can find it here:
http://www.markshelley.co.uk/webdisk/star_colour_test_image.tif
Right click the link and save on your local drive

You'll find it contains 3 sets of stars white, orange and blue.  Each star is 1.4x brighter than its neighbour.  There is a muddy sky background and the RGB balance needs adjusting - as is typical for a DSLR.

In IRIS, the processing is really straightforward:
1) Open star_colour_test_image.tif
2) Hit "Auto" on the threshold dialog just to get a good idea of what's in the image.  If you don't have a threshold dialog then go to the menu View|Threshold to make it appear.  You will see a typical "muddy" colour background.
3) With the mouse draw a small rectangle on the muddy background and type "black" [return] in a command dialog. If you don't have a command line dialog then hit the icon that has the symbols "> > ====" on it to make one appear.  The "black" command sets the black point and hence removes the background colour.  Hit "Auto" on the threshold dialog again (this doesn't alter the image - it just changes the way it is displayed on the screen).  The threshold box is probably now displaying a range from 1000 to -200 and you should be able to make out all the stars and the faint "Can you read this?" boxes in the image.
4) We now need to correct the colour balance.  Draw a rectangle inside one of the unsaturated white stars at the top or inside part of the white label boxes.  Type "white" [return].  If you now hover the mouse over the white stars you will see they have a neutral mix (you can see the RGB vlaues in the bottom right of the main IRIS window).  More importantly the colour ratios for the unsaturated orange stars are R:G:B = 4:2:1 and the blue stars are 1:2:4.
5) Now we do the asinh stretching.  Go to the menu View|ColourStretching and give it a stretch of .0040.  With the threshold dialog displaying a range of up to 1000 you should now see a set of uniformly saturated white, orange and blue stars.  Very importantly, if you hover your mouse over the orange or blue stars then the colour ratios are still correct for the unsaturatd stars i.e. 1:2:4 or 4:2:1.  The asinh has not altered the colour balance of the stars.

If you prefer, at the colour stretching stage you could instead have tried a more severe stretch of .0200.  The threshold dialog wants to be around 360 to display this well.  Or enter the command "visu 360 -20" [return] in the command line dialog box.

Have fun.

Interested to know how this works in other processing suites.
I'll try PixInsight next.

For info, here's the result I got from IRIS:



Mark

MarkS

I've now tried PixInsight, and can't make it do what I want.

I do the following:
1) Open the image in PixInsight.  The ScreenTransferFunction does a good job of showing me what's in the image.
2) I use the BackgroundNeutralisation tool to set the background to black.
3) I use the ColorCalibration tool to fix the RGB balance.  I haven't quite sussed this tool so I do a Manual White Balance of  0.85:0.72:1.0

So far, so good - if I hover the mouse over the white unsaturated stars I get the correct color ratios of 1:1:1
But already the ratios for the brighter (but previously unsaturated) orange and blue stars are drifting away from or 4:2:1 or 1:2:4 They are becoming more white.

Anyway I need to do a stretch to make the fainter stars appear.  CurvesTransformation seems to be the most likely tool
so I give it a whirl in RGB/K mode.  Yes the fainter stars begin to appear but even more of the brighter stars are turning to white.  OK, ditch that, I'll try it in L (luminance) mode instead.  Similar result - the fainter stars are appearing but more and more of the others are becoming whiter and whiter.

Gave up with CurveTransformation and tried DigitalDevelopment (DDP Filter) instead.  Very similar results.

Time to give up and go to bed.




JonH

Think I'm going to give this a pop in ImageJ. Yet another piece of software I have been recommended, is free and has full 32bit capabilitys! Plus there is a Mac version! :)
Haven't a clue how to use it so this will be ideal to learn with!
Shoot for the stars, reach the tree tops!

The Thing

I've looked at this, there are astro plugins. Never could fathom it out though, it's aimed at scientists with microscopes.

JonH

Yea it's main aim is for processing images taken threw microscopes for the medical industry and analysing them, but apparently the processing technics are very similar if not the same. I'm going to be getting a lesson in using it tomorrow from a guy at work who used to teach image processing! :)

The main reason i have been pointed towards ImageJ is because you can write your own script for it in java and make it do pretty much anything you want, something else i might be getting some lessons in. Me thinks i have bitten off more than i can chew here!  :-?
Shoot for the stars, reach the tree tops!

The Thing

We'll expect a full exposition of all it's features at a future Imaging Evening  :evil:

JonH

You also wont like it when i also tell you i'm being put in touch with a guy who works up a Essex university who does this kind of stuff profecinally!  8)

Don't worry you'll all get a full story of anything useful i learn, including a copy of any code i use if wanted. I am determined to find the perfect piece of software that will do the HDR stuff i'm trying to get my head around plus all the other processing without naffing the data!
ImageJ isn't perfect, but it can be made into anything you want so i'm saying it's a good start!

The problem i have at the moment is i'm not as smart as what i am trying to do  :!
Shoot for the stars, reach the tree tops!

Mike

Mark any chance you could provide that image in an uncompressed TIFF format please?

We live in a society exquisitely dependent on science and technology, in which hardly anyone knows anything about science and technology. Carl Sagan

MarkS

Quote from: Mike
Mark any chance you could provide that image in an uncompressed TIFF format please?

Sorry - I didn't realise it was compressed!
Try this:
http://www.markshelley.co.uk/webdisk/star_colour_test_image_uncompressed.tif

Mark

RobertM

Were some of the artificial coloured stars intentionally clipped ?

MarkS

Quote from: RobertM
Were some of the artificial coloured stars intentionally clipped ?

Yes - to more closely replicate what happens in real life!

MarkS

PixInsight can now do this successfully!

Once you have performed BackgroundNeutralisation followed by ColorClibration, the trick is to use PixelMath to exactly duplicate what the IRIS asinh (colour stretch) function does.

Explanation here:
http://forum.orpington-astronomy.org.uk/index.php?topic=8723.msg60393

For this particular image I used a colour stretch parameter of "a=0.0400" which is very strong.  Followed by a rescale of 2.0 with "Rescale result" unticked.

Hovering the mouse over the unsaturated stars gives RGB readouts in the correct proportions i.e. 1:1:1 (white), 4:2:1 (orange), 1:2:4 (blue)

Result can be seen here:
http://www.markshelley.co.uk/webdisk/star_colour_pixinsight_result.jpg

Mark

RobertM

I can see what's wrong in PI.  It seems to have scaled the data incorrectly.  Taking for example the 6th brightest red star:

Before PI: R=65534, G=44228, B=15988
After Color calibration using a range of the white stars: R=53531, G=31121, B=15530 (notice the reduction in red signal.

Now after careful selection of a star with non saturated pixel values for the white reference (9th brightest white) I get R=65534,G=42526,B=15404 which looks a lot more sensible.  It's a similar story for Blue.

I think this proves that PI can do the colour calibration step properly but that is does depend a lot on having the correct information from which to do it's calculation.  Trouble is it's telling when it's correct !  This is a bit of an eye opener and means I'll have to carefully select a portion of the image with no saturated stars, either that or start using either G2V images or eXcalibrator for colour calibration in future  :-?

I'll have another go at one of my recent images based on this info and try the asinh code too (thanks for that).

Robert




MarkS

Robert,

Interesting observations on your colour calibration.

I managed to get mine to work by cheating slightly - selecting an area on one of the white text boxes!  I'll try it on one of the white unsaturated stars and see what happens (both in PI and in Iris).

It's interesting to experiment when you already know in advance what the true result should be - it does highlight limitations in process flow.

Mark

RobertM

I also used one of the white text boxes when I realised what was happening before switching over to one of the unsaturated stars and getting the same result.

I've also been comparing your Soul nebula image to mine and while I'm convinced I have more data I still can't get the richness of your star colours without making the nebula appear artificial.  This is really bugging me so I'm going back to the stacking yet again to see what's going on then follow it through step by step.

Robert

Mac

Photoshop CS4,
My attempt.
Total time about 5min. (repeatable)
1) Convert Image to 32bit
2) Convert Image back to 16 bit. (I used exposure and gamma method)
3)Adjust exposure and gamma to suit. +6.5 Exposure, +1.5 Gamma
4)Add adjustment layer for colour balance
5) place cursor over known neutral area, (unsaturated star or background layer) you could even use a gausian blur of 255 over the entire image and then sample that, note the adjustment, undo the blur and stick in the adjustment figures
6) Adjust mid tone using sliders, but observing the info tool, to get the CYMK value of the pixel, adjust until colour cast has been removed. -41 on top slider, -25 on middle, 0 on bottom
    (you only need to ever adjust two sliders)
7)add brightness and contrast adjustment layer, and adjust to suit, +20 on both brightness and contrast.

This is my result, which would now be my starting point for further adjustments.



Mac.  :cheesy:

Mike

This is a really interesting test image Mark and is great for testing out the stretching functions in image processing software to see what damage they do and also how to do it correctly. If you get it right with the test image  then it theory the same settings should also work for the astro images. It makes me wonder what kind of test images could be created for other parts of the imaging process.
We live in a society exquisitely dependent on science and technology, in which hardly anyone knows anything about science and technology. Carl Sagan

MarkS

#17
Quote from: Mike
This is a really interesting test image Mark and is great for testing out the stretching functions in image processing software to see what damage they do and also how to do it correctly.

That's right - it gives a good understanding of what is really going on.

Quote from: Mike
If you get it right with the test image  then it theory the same settings should also work for the astro images.

Yes - but maybe with some minor tweaking

Quote from: Mike
It makes me wonder what kind of test images could be created for other parts of the imaging process.

Interesting idea.

MarkS

#18
If you're interested, here's the orginal paper "Preparing RGB images from CCD data" by Lupton et al which advocates using scaling functions that adjust the "intensity" of each pixel whilst preserving the R:G:B ratio (i.e. the "colour")
http://arxiv.org/pdf/astro-ph/0312483v1.pdf

It doesn't have to be asinh - any kind of curve would do, in fact.  Trouble is all "curves" functions in Photoshop, PixInsight etc seem to destroy those ratios - or am I just using them wrongly?  It certainly ought to be possible to apply a "curves" function to "intensity" whilst preserving the pixel's R:G:B ratio.

Mathematically it's not difficult ...

[Edit:  By the way, this isn't restricted to RGB images - it applies equally to "Hubble palette" narrowband images]

The Thing

Quote from: MarkS on Oct 26, 2012, 07:46:53
It certainly ought to be possible to apply a "curves" function to "intensity" whilst preserving the pixel's R:G:B ratio.


I have seen selections in curves tools to allow only the luminance to be affected. GIMP calls it Value, shame it's only an 8 bit program. Is this the same thing?

MarkS

Quote from: The Thing
I have seen selections in curves tools to allow only the luminance to be affected. GIMP calls it Value, shame it's only an 8 bit program. Is this the same thing?

It depends on how it is implemented.  That's why I created the test image - it allows you to verify what the implementation does.

JonH

There is a similar option in Iris I think on the contrast adjustment. Can select luminescence, RGB or the individual channels.
I haven't played with it much though.
Shoot for the stars, reach the tree tops!

RobertM

PI can do the same - luminance, RGB or R/G/B separately, in fact it's the same with most the tools.

Robert

MarkS

Quote from: RobertM
PI can do the same - luminance, RGB or R/G/B separately

When you get a chance, would you try applying a PI luminance curve.  I found it affected the RGB ratios in the test image - but I might have been doing it wrong - I'm not yet experienced enough in PI.  On the other hand it could be that "luminance" may not be the quantity we want to adjust.  It is likely that the definition of luminance changes according to the selected colour model.  But I tired changing colour model as well, without getting the results I wanted.  Which is why I finally had to resort to writing a PixelMath function that does what the Lupton paper suggests.

But if luminance curves can be made to work then they would allow far more flexibility than the asinh function.

Ivor

#24
I saw FITS liberator was missing from the test group so I had a go


test_rgb by running_ivor, on Flickr

FITS Liberator will let you work on the individual channels and use an broad list of stretch functions, in this case I used arcsinh() however I think some of the others could produce interesting results. I scaled the peak level to 10K, I allowed clipping on the white level in each channel but none on black. I merged the files in PS CS4 and using levels to align the RGB channels.

I've moved the image to flickr and copied the url into the [img] tag however it doesn't come up and the image is set to visable to all what have I missed?

(Edit: The easy way to get images from Flickr into the forum is to use the BBCode option -- Rick)

MarkS


Ivor,

The white stars look a bit green to me - I'm not sure why ...

Mark

Ivor

#26
Yes I think you're right, it's this damm screen of mine, it's really difficult to do things by eye correctly. I've looked in PS and the green channel is off to the right in the histogram, I've adjusted it now


test_rgb-II by running_ivor, on Flickr

I see someone updated my previous image how do you find the farmstatic link to the image?

(Edit: On Flikr, click "Share" then "Grab the HTML/BBCode" then the BBCode button. Select all, copy and paste. -- Rick)