Galaxy Templates via STANDARD .BMP Format, DOWNLOAD!
Posted: 14.03.2006, 20:25
Hi all,
I want to expose new code for handling galaxy templates via the standard .BMP format.
My new approach has lots of advantages over Toti's "homemade" .pts format that can only be "pseudo-edited" with his rather cumbersome bmp2pts tool. Worst of all, the .pts format is a vaste of storage as we shall see. This latter aspect is particularly crucial for future developments, like significantly extending the number of templates to include the extended Hubble scheme or also individual color profiles!
++++++++++++++++++++++++++
NOTE that Celestia already contains ALL required code for loading the standard .BMP format that --best of all-- may be edited with EVERY image manipulation software and is a factor ~ 25 more economical as to storage!
++++++++++++++++++++++++++
Why is the .pts format such a vaste? Well, that's easy to see:
Imagine a 128x128 grayscale template image. Each of the 128x128 = 16384 pixels of this image is just characterized by an 8bit integer specifying its brightness. In case of simple (8bit x3) RGB color images, the same scheme applies, except each integer is replaced by three, designating the respective R,G,B colors instead of brightness, only. Usually, there is some header in addition, containing info about the image size, some "magic number" etc...
Instead of just one byte for brightness at position i of the image vector, Toti's .pts format uses 4 floating point numbers to carry the same information: x,y,z, br. It is close to trivial, however, to quickly map the integer brightness value of popular formats like .pgm, .ppm, .bmp, ... at some position i in the vector of length 128x128=16384 to the required 2d float positions (x,z) after loading the image. This mapping has to be done only once after loading, thus costing no frame rate! Similarly the y extension can be easily generated within Celestia without penalty. My new code is of course not restricted to 128x128 sized gray templates...
Here is a comparison of the storage needed of our present .pts files compared to the equivalent .BMP templates:
e,g, S0: S0.pts => 378 KB while S0.bmp => 17.0 KB
So we can have 140 (!) equivalent templates instead of the present 7 for the same storage consumption.
+++++++++++++++++
The greatest advantage is that everyone now can experiment with his custom .BMP templates using GIMP or Photoshop or whatever, exploit layers, standard brightness normalization and all the beloved "luxus" features of these advanced image manipulation programs. A future extension to individual color profiles for DSO's is utterly trivial.
+++++++++++++++++
How can you profit from the new feature?
To incorporate the new format amounted to a thorough recoding of the galaxy.cpp file only and a conversion of the .pts templates to .bmp format. If people are interested, I wrote PERL routines that do these conversions in both directions...The most essential code changes you'll find in the method buildGalacticForms(const std::string& filename).
All this may be downloaded and tried out from my TextureFoundry site:
++++++++++++++++++++++++++++++++++++
http://www.celestiaproject.net/~t00fri/celesti ... plates.zip
++++++++++++++++++++++++++++++++++++
All you got to do is to
throw the 7 .BMP templates into the 'models' directory, to exchange the file galaxy.cpp in the src/celengine directory and rebuild celestia. PLease use the current version 1.4.1 for this or better the latest CVS version.
Let me know how things go. The galaxy display is of the same quality as before.
Enjoy,
Bye Fridger
I want to expose new code for handling galaxy templates via the standard .BMP format.
My new approach has lots of advantages over Toti's "homemade" .pts format that can only be "pseudo-edited" with his rather cumbersome bmp2pts tool. Worst of all, the .pts format is a vaste of storage as we shall see. This latter aspect is particularly crucial for future developments, like significantly extending the number of templates to include the extended Hubble scheme or also individual color profiles!
++++++++++++++++++++++++++
NOTE that Celestia already contains ALL required code for loading the standard .BMP format that --best of all-- may be edited with EVERY image manipulation software and is a factor ~ 25 more economical as to storage!
++++++++++++++++++++++++++
Why is the .pts format such a vaste? Well, that's easy to see:
Imagine a 128x128 grayscale template image. Each of the 128x128 = 16384 pixels of this image is just characterized by an 8bit integer specifying its brightness. In case of simple (8bit x3) RGB color images, the same scheme applies, except each integer is replaced by three, designating the respective R,G,B colors instead of brightness, only. Usually, there is some header in addition, containing info about the image size, some "magic number" etc...
Instead of just one byte for brightness at position i of the image vector, Toti's .pts format uses 4 floating point numbers to carry the same information: x,y,z, br. It is close to trivial, however, to quickly map the integer brightness value of popular formats like .pgm, .ppm, .bmp, ... at some position i in the vector of length 128x128=16384 to the required 2d float positions (x,z) after loading the image. This mapping has to be done only once after loading, thus costing no frame rate! Similarly the y extension can be easily generated within Celestia without penalty. My new code is of course not restricted to 128x128 sized gray templates...
Here is a comparison of the storage needed of our present .pts files compared to the equivalent .BMP templates:
e,g, S0: S0.pts => 378 KB while S0.bmp => 17.0 KB
So we can have 140 (!) equivalent templates instead of the present 7 for the same storage consumption.
+++++++++++++++++
The greatest advantage is that everyone now can experiment with his custom .BMP templates using GIMP or Photoshop or whatever, exploit layers, standard brightness normalization and all the beloved "luxus" features of these advanced image manipulation programs. A future extension to individual color profiles for DSO's is utterly trivial.
+++++++++++++++++
How can you profit from the new feature?
To incorporate the new format amounted to a thorough recoding of the galaxy.cpp file only and a conversion of the .pts templates to .bmp format. If people are interested, I wrote PERL routines that do these conversions in both directions...The most essential code changes you'll find in the method buildGalacticForms(const std::string& filename).
All this may be downloaded and tried out from my TextureFoundry site:
++++++++++++++++++++++++++++++++++++
http://www.celestiaproject.net/~t00fri/celesti ... plates.zip
++++++++++++++++++++++++++++++++++++
All you got to do is to
throw the 7 .BMP templates into the 'models' directory, to exchange the file galaxy.cpp in the src/celengine directory and rebuild celestia. PLease use the current version 1.4.1 for this or better the latest CVS version.
Let me know how things go. The galaxy display is of the same quality as before.
Enjoy,
Bye Fridger