It is currently Thu, 18-07-19, 19:31 GMT

All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject:
PostPosted: Sat, 19-12-09, 14:09 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4629
Location: Hamburg, Germany
Hi all,

before showing you next time the final result of this galaxy coloration project in form of representative, individually colored galaxies, let me tell you a bit more about the strategy and custom tools that I have used.

Custom tools (Maple) were essential for trying out various color profiles quickly, notably in comparison to my reference SDSS set that is matched to the RC3 galaxy catalog:

http://cosmo.nyu.edu/hogg/rc3/

+++++++++++++++++++++++++++++
First of all, how can we parametrize complex RGB color profiles for individual galaxies most easily and intuitively, i.e matched to the actual requirements of the project?
+++++++++++++++++++++++++++++

The trick is to compose the galaxy color profiles NOT in R,G,B color space but rather in the so-called H,S,V space. Here H=Hue, S=Saturation ("color intensity") and V=Value ("brightness").

The transformation between RGB and HSV is a standard task in image manipulation. I have also written a corresponding C++ method in Celestia long ago.

Why is color matching in the HSV basis so much simpler?

Well in first approximation, during the coloration process, one may set the Value (<=> brightness) and the Saturation (<=> "color intensity") equal to some convenient, constant value across a galaxy! Then the coloration task reduces to just parametrizing the desired Hue profile (instead of THREE profiles for the individual R,G,B colors!). After the color transition (Hue) is settled correctly, one then proceeds to tune both the two intensities (S and V) in a second step. The latter does interfere very little with the Hue settings, which makes the coloration task so much simpler and more intuitive.

The Hue is usually given in degrees within the range 0 <= H <= 360 degrees. Here is a nice circular Hue display (from The GIMP):
Image

In this example, the Hue is located along the circle, increasing counter-clockwise. Presently we have set H=0 (white bar on circle). The actual color with V=100% and S=20% is displayed as well at the bottom.

++++++++++++++++++++++++++++
For Celestia (.Sci), we need to map the Hue values across a galaxy to a field, the so-called colorindex, with 256 (r,g,b) - triplet entries (i = 0..255). These triplets denote the sprite color starting from the galaxy center (i=0) and increasing towards its periphery (i = 255).
++++++++++++++++++++++++++++

What I needed next was a mathematical function that allows to implement intuitively -- yet precisely-- the transition of the Hue from a desired starting value (hue0) to a final one (hue1), at a particular location of the colorindex (i=i0) with a certain "transition speed" = slope.

Hence I determined a very flexible and intuitive hue-transfer function from the ansatz
Code:
hue = a - b * tanh(-i /c+slope)

involving the 4 parameters a, b, c, slope besides the colorindex i.
The three parameters a, b, c were fixed in terms of hue0, hue1, i0 and slope with Maple from the 3 conditions:
  • at i -> 255 ~ 'infinity': hue = hue1;
  • at i = 0 : hue = hue0;
  • at i = i0 : hue = (hue0 + hue1) / 2;
    i.e. i0 = hue transition point in i

The result then reads:
Code:
hue = hue1 + (hue1 - hue0)/sl * ( -1 + tanh( i * (slope - arctanh(sl / 2 - 1))/i0 - slope)));
with hue-transition "engine"
sl = tanh(slope) + 1;

As desired, the transition hue0 -> hue1 gets much sharper for increasing slope parameter. Remember that the hyperbolic tangens, tanh(x), varies between -1 and +1.

For Saturation and Value profiles in the second step, I also chose some flexible, intuitive forms. As a last convenience, I implemented the option of skipping a certain band of colors (green!) during the hue transition.

The resulting tool and the ImageTools package of Maple 13 then allowed quickly AND intuitively to try out any desired H, (and S,V) profiles in terms of a realistic RGB test image.

++++++++++++++++++++++
Notably after these considerations, I can just measure the initial and final H,S,V values of any SDSS galaxies with the GIMP "pipette" tool and Maple/C++ code do the rest.
++++++++++++++++++++++

Here are some actual example plots generated with my corresponding Maple code:

Look e.g. at this SDSS galaxy, NGC 3344 with a measured value B-V = 0.57 according to the RC3 galaxy catalog. As you can see, it's indeed quite blue but still with an ochre/orange center ... So a "visual blueness" B-V=0.57 seems adequate.

Image

According to the GIMP "pipette tool", the colorindex profile should start around Hue = ochre/orange ~ 37 in the galaxy center, transiting quickly (slope = 5.0, say) to Hue=blue ~ 208 in the outer regions. In addition the green band of hue (50<H<180) must be skipped during the transition!

Here is what my Maple tools display for such a configuration:

First the corresponding plots of Hue, Saturation and Value
(Click for Big!)

Image

Note that a more realistic behaviour of S,V than a constant has also been implemented. Again the "pipette tool" provides central and peripheral values for the galaxy under consideration...

Then, after my Maple code combined quickly the H,S,V layers and transformed them to RGB color space, here is the image content of the colorindex (i=0..255)
top: combined layers in RGB space,
bottom: R,G,B layers displayed separately as grayscale images.

Image

Since my modified C++ code in galaxy.cpp has all these considerations implemented as well, Here is the color result of Celestia.Sci for this configuration.

Image

Suppose, I now wanted to see what the galaxy would look like with a somewhat redder central region (and everything else the same) I just enter hue0=17, say (instead of 37) and Maple instantaneously gives this:

Image

A Celestia.Sci run indeed confirms the redder center:

Image

I hope this was kind of instructive? However, the actual procedure was considerably more involved ;-) ...

Fridger


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 19-12-09, 20:09 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 432
Location: Tuscany, Tyrrhenian Sea
:shock:


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 19-12-09, 20:22 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4629
Location: Hamburg, Germany
fenerit wrote:
:shock:


That "face" is hard to interpret ;-)

Fridger


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 19-12-09, 20:38 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 432
Location: Tuscany, Tyrrhenian Sea
t00fri wrote:
fenerit wrote:
:shock:


That "face" is hard to interpret ;-)

Fridger


I'm shocked! Practically you have solved the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 19-12-09, 20:41 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4629
Location: Hamburg, Germany
fenerit wrote:
t00fri wrote:
fenerit wrote:
:shock:


That "face" is hard to interpret ;-)

Fridger


I'm shocked! Practically you have solved the problem.


Yes ;-)

Fridger


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 19-12-09, 21:35 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 432
Location: Tuscany, Tyrrhenian Sea
Just curious, then I no longer escape out the topic: such Celestia.sci does is mind as "complement pack" for official distributions or is an "abarth" version by you? For instance, the galaxy render c++ code needs to be changed for accomplishing that beautiful behaviour: will these changes belong to all the next Celestia's versions or just to .sci?


Top
 Profile  
 
 Post subject:
PostPosted: Sat, 19-12-09, 21:50 GMT 
Offline
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4629
Location: Hamburg, Germany
fenerit wrote:
Just curious, then I no longer escape out the topic: such Celestia.sci does is mind as "complement pack" for official distributions or is an "abarth" version by you? For instance, the galaxy render c++ code needs to be changed for accomplishing that beautiful behaviour: will these changes belong by all the next Celestia's versions or just to .sci?


For now, Celestia.Sci is merely a "name" to the outside ;-) . Precise definitions, modalities and more will follow when things are getting ready. This may still take a while, since so far, I am working just by myself. Also, I don't want to spend all my spare time in front of a computer;-) ...

Unfortunately, Celestia.Sci developments are not available for download before a first release of the project has taken place. I continue to develop also for the official Celestia distribution, just like ChrisL is involved BOTH in Celestia and Celestia.STA.

Fridger


Last edited by t00fri on Sat, 19-12-09, 21:56 GMT, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat, 19-12-09, 21:53 GMT 
Offline
User avatar

Joined: Mon, 03-09-07, 23:01 GMT
Posts: 432
Location: Tuscany, Tyrrhenian Sea
Ok.

_________________
Never at rest.
Massimo


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group