From the course: Exploring C Libraries
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Manipulating JPEG images - C Tutorial
From the course: Exploring C Libraries
Manipulating JPEG images
- [Instructor] In this movie, I demonstrate three JPEG manipulations made possible by using the libjpeg library. First, this code reads in a color JPEG image and outputs that same image, but in grayscale. Effectively, the code removes the color elements from the image. The key option is set at line 32, which directs libjpeg to decompress the input file as grayscale. This option is also set at line 84 where the output file is compressed. I've already compiled and linked the program file. So it will run, and it reports that the grayscale image was created. I'll go to a folder window where you can see the original fie preview shown here. And here's the duplicate, but in grayscale. This exercise file takes the input file and shrinks it to 1/4 size. The resizing options are set at lines 32 and 33 as the numerator and denominator of the decompressed image's size. Now, these are the only options that need to be set. The…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.