Assignment overview
In this assignment, you will write a command-line program in C to interact with PNG (Portable Network Graphics) image files. The goal is to familiarize yourself with systems-level C programming through a realistic and challenging project.Learning objectives
This homework focuses on developing skills in:File I/O
Reading and writing binary file formats with precise byte-level control
Pointers & Memory
Dynamic memory allocation, pointer manipulation, and memory management
Bitwise Operations
LSB manipulation for steganography and bit-level data processing
Data Structures
Working with complex binary structures and endianness conversions
What you’ll build
You will implement a PNG manipulation tool that can:Parse PNG files
Read and validate PNG file structure, including signature verification and chunk parsing
PNG specification
The official PNG specification is available at: You should familiarize yourself with the specification, particularly:- The 8-byte PNG signature
- Chunk structure (length, type, data, CRC)
- IHDR chunk format (image header)
- PLTE chunk format (color palette)
- IDAT chunks (image data)
- Big-endian integer encoding
Project structure
The assignment template includes:Allowed libraries
For this assignment: Allowed:glibc(GNU standard C library) includingmalloc,calloc,fgetc, etc.zliblibrary for data compression/decompression- Sample CRC code from the PNG specification appendix
- Binary libraries other than
glibcandzlib - Existing PNG manipulation libraries
Submitting code that uses disallowed libraries will result in a zero grade and potential academic dishonesty charges.
Academic integrity
You must write your own code. You are not permitted to:- Submit source code you did not write yourself
- Use code from the internet or other students
- Use AI-generated code without understanding and documenting it
- Base code provided in the template repository
- Code explicitly permitted in writing by the instructor
Timeline and expectations
This is a challenging project. You should:- Start immediately - Do not wait until the last week
- Allocate regular time - Work on it consistently over several weeks
- Experiment with data - Use
hd(hex dump) to examine PNG files - Write your own tests - The provided tests are minimal
- Test incrementally - Don’t wait to test everything at once
Getting help
Resources available to you:- README.md - Detailed assignment specification
- Piazza - Check for updates and clarifications
- Office hours - Get help from TAs and professor
- PNG specification - Official documentation
- Beej’s Guide to C - Excellent C programming reference
Next steps
Requirements
Review detailed assignment requirements
CLI arguments
Start with Part 1: command-line processing
PNG format
Learn about PNG file structure
API reference
Explore the PNG API functions