2
\$\begingroup\$

I want to generate mipmaps for 2D textures as an offline step. My priority is for image quality, execution time is not a concern. The images will, naturally, always be halved and will always be powers-of-2.

I've found this fine article on the subject, which was helpful, but I don't have much knowledge on filtering, so I'm not very sure where to start.

I'm looking for algorithms and hopefully some sample implementations that I can base myself on. Also, using a third party library is an option, as long as it is open source and portable C or C++.

Any help is appreciated.

\$\endgroup\$
3
  • \$\begingroup\$ For offline generation I'm not certain why you have the open-source/portable requirements. Surely you can just generate them on any machine then ship them with your game. Whether or not the generated mips will be portable depends on your chosen format, not your generation tool (provided it supports the format, of course). You may be limiting your options with these requirements. \$\endgroup\$ Commented May 5, 2014 at 18:48
  • \$\begingroup\$ Are you looking for code or does a plugin for Photoshop suffice? \$\endgroup\$ Commented May 5, 2014 at 18:53
  • \$\begingroup\$ Yes, I agree with you Jimmy. What I really want to avoid is licensing issues. That's why open source libraries would be best. @LumpN code of any kind that I can use as a reference. I wish to integrate this with a custom tool. \$\endgroup\$
    – glampert
    Commented May 5, 2014 at 18:56

2 Answers 2

7
\$\begingroup\$

You might look into ImageMagick. It's open-source and contains code for resampling images using a variety of filters including Lanczos, Kaiser, Gaussian, etc. It can be used as a library linked into your code, and/or as a set of command-line tools you can call from shell scripts and suchlike.

\$\endgroup\$
3
\$\begingroup\$

I have settled with the NVidia Texture Tools library. It has a lot of good texture filters plus other things that might be useful in the future, such as GPU accelerated DXT texture compression. The library is Open Source and released under the MIT licence, which is very unrestrictive.

Thanks for all the replies and comments.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .