Help Me Find A Good C Image Library
moultano
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
in Off-Topic
<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.
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
Chris
<edit>pixels -> colour channels</edit>
I wish all code was this cool.
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.