From the course: Exploring C Libraries

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Working with PNG images

Working with PNG images - C Tutorial

From the course: Exploring C Libraries

Working with PNG images

- [Instructor] To read, write, and modify PNG or ping image files add the libpng library to your C-languages toolbox. Its home is here at libpng.org. Choose the libpng link to read about the library, get reference material, and sample code. To install libpng, open a terminal window and use the shell's package manager to locate libpng-dev. For Homebrew on the MAC, look for just libpng. Obtain and install the library on your computer system. This source code file helps verify the installation. It outputs the installed libpng version number. Compile the code like this. Type the name of your favorite C-language compiler, I use clang, tack on the Wall switch, which identifies all warnings, and then -l for link in, and png for the PNG library. Finally, the source code filename. The program is built, now if you see a link or error, specify the -lpng switch last. And it runs. The code in this exercise file reads the PNG…

Contents