Where do default textures come from

Tips for creating and manipulating planet textures for Celestia.
Topic author
bidmaron
Posts: 44
Joined: 10.04.2005
With us: 19 years 5 months
Location: Portsmouth, NH

Where do default textures come from

Post #1by bidmaron » 31.07.2006, 02:19

I was going to add an alternate texture by copying the earth's image and then doing some edits on it. I have the basic default Celestia install on Windows XP right now, and when I go to the hires folder of the Celestia\textures folder, there are (of course for the default intall) no files present. When I go to medres, there are a couple of earth files, to include the surface texture. However, when I copy it and open the copy in a Paint program, the continental landforms are transparent.

The question: Where does Celestia get its earth landform textures from when my resolution [R] setting is at maximum resolution since there are no hires textures and the medres doesn't have the landform colors.
--Dale--
--Dale--

steffens
Posts: 162
Joined: 06.11.2003
With us: 20 years 10 months
Location: RP Germany

Re: Where do default textures come from

Post #2by steffens » 31.07.2006, 06:50

bidmaron wrote:When I go to medres, there are a couple of earth files, to include the surface texture. However, when I copy it and open the copy in a Paint program, the continental landforms are transparent.

The question: Where does Celestia get its earth landform textures from when my resolution [R] setting is at maximum resolution since there are no hires textures and the medres doesn't have the landform colors.
--Dale--

You already found the right file!
There is no hires earth texture in the default Celestia release bundle, only medres and lores. The landmasses are transparent, because the texture has an alpha channel that is used as specularity map. Landmasses are not supposed to reflect a lot of specular light, that's why the alpha channel is set to full transparent in these places.
Depending on the software you use to view/edit images, you should be able to disable the alpha channel or remove it from the image.

steffens

Topic author
bidmaron
Posts: 44
Joined: 10.04.2005
With us: 19 years 5 months
Location: Portsmouth, NH

Post #3by bidmaron » 01.08.2006, 01:02

Steffens, thanks for the reply. The only photo software I have is PSP, and when I open the medres earth.png, there is a checkerboard transparent alpha on all land and ice. There isn't a separate layer, so I can't figure out how to see the land. I hate being a rock.

--Dale--
--Dale--

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #4by selden » 01.08.2006, 11:58

Dale,

The convention is that "checkerboard" means that there is an Alpha channel and that it's transparent where you see the checkerboard.

I'm not a PSP user, though. Someone else will have to help you with it. I usually use ImageMagick or NetPBM to extract the different channels from an RGBA image.
Selden

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years
Location: Bridgwater,UK

Post #5by jestr » 01.08.2006, 19:58

Hi Dale,actually there is no alpha channel in the earth default texture,at least when opened in Photoshop.I dont know of any way to view the land mass image in Photoshop.When you open the texture in Irfanview (free download) it shows all of the Earth though.It is an odd file,I think if I remember correctly Chris made it,though i cant remember how he went about it,but it works fine in Celestia.Jestr

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #6by selden » 01.08.2006, 20:21

jestr,

I'm sorry to have to contradict you, but according to the ImageMagick utility "identify", the file /lores/earth.png has an alpha channel and so does the /medres/ version.
$ identify -verbose earth.png
Image: earth.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 256x256
Type: TrueColorMatte
Endianess: Undefined
Colorspace: RGB
Channel depth:
Red: 8-bits
Green: 8-bits
Blue: 8-bits
Alpha: 8-bits
Channel statistics:
Red:
Min: 0 (0)
Max: 253 (0.992157)
Mean: 77.8066 (0.305124)
Standard deviation: 91.7189 (0.359682)
Green:
Min: 12 (0.0470588)
Max: 246 (0.964706)
Mean: 96.153 (0.377071)
Standard deviation: 78.2902 (0.30702)
Blue:
Min: 23 (0.0901961)
Max: 243 (0.952941)
Mean: 106.455 (0.41747)
Standard deviation: 68.2096 (0.267489)
Alpha:
Min: 255 (1)
Max: 1 (0.00392157)
Mean: 138.927 (0.54481)
Standard deviation: 122.328 (0.479716)
Colors: 19580
Rendering intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 95.498kb
Interlace: None
Background color: white
Border color: #DFDFDF00
Matte color: grey74
Page geometry: 256x256+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Signature: b577f492abd338b49dfcdb175e4b2ff5b2fe57428b780af8a3a084521983e635
Tainted: False
Version: ImageMagick 6.2.8 07/27/06 Q16 http://www.imagemagick.org


The following ImageMagick utility command extracts the Alpha channel as a separate file:

Code: Select all

$ convert earth.png -channel matte -separate +channel -negate alpha.png

(Negate is required because ImageMagick uses the opposite definition of the values. *grump* )

And here's the lores Alpha channel itself:
Image
.
Selden

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years
Location: Bridgwater,UK

Post #7by jestr » 01.08.2006, 20:27

Hi Selden,this isnt the case when opened in Photoshop.In Photoshop it only shows the sea parts in layer0,and has no alpha channel.Obviously it opens OK in other image software.Jestr

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #8by selden » 01.08.2006, 20:43

FWIW, the ImageMagick command to create an RGB image file that does not contain an Alpha channel from an RGBA image (like earth.png) that does contain one is

Code: Select all

$ convert earth.png +matte noalpha.png


[edit]
ImageMagick is freeware and can be downloaded from SourceForge:
http://sourceforge.net/project/showfile ... p_id=24099
[/edit]
Selden

Topic author
bidmaron
Posts: 44
Joined: 10.04.2005
With us: 19 years 5 months
Location: Portsmouth, NH

Post #9by bidmaron » 02.08.2006, 11:02

Thanks, Selden. Got the software.
--Dale--
--Dale--


Return to “Textures”