Page 1 of 1

Alpha channel cration

Posted: 13.01.2007, 19:08
by abramson
Hello. I have been trying, unsuccesfully, to insert, or create, an alpha channel, into a preexisting png image that initially does not have it. Specifically, I am trying to inster the greyscale watermask into the alpha channel of a base texture, to use it (the alpha) as specular texture. I am trying to do this with ImageMagick, and I have been reading the documentation and the web, without success. Does anybody know how to instruct the "convert" tool to do this? Thanks in advance.

Guillermo

Posted: 13.01.2007, 21:15
by selden
Like too many technically simple operations, it's as if the authors went out of their way to make the command obscure. It doesn't help that the functionality actually is broken in some of the releases :(

Code: Select all

convert rgb_input_image.png greyscale.png +matte -compose CopyOpacity -composite rgba_output.png

Re: Alpha channel cration

Posted: 13.01.2007, 21:44
by t00fri
abramson wrote:Hello. I have been trying, unsuccesfully, to insert, or create, an alpha channel, into a preexisting png image that initially does not have it. Specifically, I am trying to inster the greyscale watermask into the alpha channel of a base texture, to use it (the alpha) as specular texture. I am trying to do this with ImageMagick, and I have been reading the documentation and the web, without success. Does anybody know how to instruct the "convert" tool to do this? Thanks in advance.

Guillermo


Guillermo,

as Selden said, ImageMagick is unfortunately broken in many places and also works badly for large files. It has always been a mystery to me why in IM the quality control is sooo bad. They fix one bug and introduce two new ones instead ;-) . The number of (sub)versions is also kind of inflationary...Imagine the author started off with this project when we were all using ATARI computers...!

You did not tell us whether your typical png images are small enough to be loaded into GIMP given your RAM size? In GIMP things are MUCH easier and more reliably done.

Bye Fridger

Posted: 14.01.2007, 01:08
by abramson
Thanks, guys. I will try with IM as Selden says, or switch to Gimp. It is my first attempt at specularity. Eventually I would like to put the 64k watermark into the 64k base map. I don't know if tile by tile or at some intermediate step. I have 1GB at home, 2GB at my office, and probably access to some machine with more memory, they keep commint and I dont remember any more.

I have just returned from the lakeside, where we saw comet McNaught setting behind the Andes. It's the first day its visible from here. Tomorrow I will go outside with the telescope.

Thanks,

Guillermo

Posted: 14.01.2007, 03:38
by selden
Don't forget that Celestia can use a separate specularity texture map. You don't have to make it part of the surface texture map image file.

Posted: 14.01.2007, 11:04
by t00fri
selden wrote:Don't forget that Celestia can use a separate specularity texture map. You don't have to make it part of the surface texture map image file.


But using RGBA instead of /separate/ RGB + spec saves lots of graphics card memory as explained by Chris already a long long time ago in the dev list...

Incidentally, the best way of manipulating the alpha channel with a recent version of IM is via the 'fx' special effects image operator!

There is even a special tutorial of FX stuff:

http://www.imagemagick.org/script/fx.php

Bye Fridger