Help Me Find A Good C Image Library

moultanomoultano Creator of ns_shiva. Join Date: 2002-12-14 Member: 10806Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Gold, NS2 Community Developer, Pistachionauts
<div class="IPBDescription">Reworking some texture generation code</div> I wrote some code in a graphics class last year that I think could be a helpful tool for making textures, and could possibly increase the resolution of textures automatically (which if successful, could make a source port of NS much easier.)

Problem is, the image reading library I was using at the time sucks, and I don't have access to either the source code or a windows version of it, so I'm looking for a better image library. I found the GD library, but it cuts a bit of precision off of the alpha channel for images with transparancy, and I'm wondering if there is anything better out there.

If anyone could help me out, it would be greatly appreciated.

Comments

  • minskminsk Join Date: 2003-01-09 Member: 12077Members
    edited June 2005
    Know <a href='http://www.imagelib.org' target='_blank'>DevIL</a> will allow 32-bit integer (or double-precision float) colour channels internally. At least some of the import/export filters should be capable of matching it.

    Chris

    <edit>pixels -> colour channels</edit>
  • moultanomoultano Creator of ns_shiva. Join Date: 2002-12-14 Member: 10806Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Gold, NS2 Community Developer, Pistachionauts
    Thanks a lot. That looks like it fits the bill. Shame it doesn't look like the project is very active.
  • moultanomoultano Creator of ns_shiva. Join Date: 2002-12-14 Member: 10806Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Gold, NS2 Community Developer, Pistachionauts
    Man, I'm reading through the documentation, and this thing rocks! <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile-fix.gif' border='0' style='vertical-align:middle' alt='smile-fix.gif' /><!--endemo-->
    I wish all code was this cool.
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    I don't have anything helpful to add, but I will say good luck to you, and you have my deepest sympathies. :P
  • Soylent_greenSoylent_green Join Date: 2002-12-20 Member: 11220Members, Reinforced - Shadow
    edited June 2005
    <!--QuoteBegin-moultano+Jun 27 2005, 08:31 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (moultano @ Jun 27 2005, 08:31 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I wrote some code in a graphics class last year that I think could be a helpful tool for making textures, and could possibly increase the resolution of textures automatically (which if successful, could make a source port of NS much easier.) <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Not to be a negative nellie here, but increasing resolution doesn't make sense when you have no more detail to display. I can't imagine that there would be a general approach to add detail that is non existent that is significantly better than the linear magnification filter used in regular 3d rendering. The best I can think of is to upscale using high quality bicubic and sharpen the image, but that's a minor quality improvement at a large cost to memory. You could also modulate the texture with a repeating high resolution texture simular to a detail texture, but then you lose generallity and have to tinker with each texture by hand and it will work well only for a minority of textures that are relatively plain.

    I'm sure there's better approaches but I still don't see it being much better than regular upscaling.

    You still have to generate things like normal maps( and possibly gloss maps). This can be done in some hacky fashion too. I've seen generating a black and white image as a weighted average of colour components(simple dot product between 2 colour triplets, one constant triplet corresponding to how bright each colour looks to the eye, i.e. green is more important than red or blue) and a normal map using convolution filters to generate each component(like emboss in different directions which will identify edges in different directions). Might look better than no normal map at all but it's going to look a lot better with a proper texture made from scratch.

    Normal map generation I can see as being usefull but there are allready tools for this doing something along the lines of the above.
Sign In or Register to comment.