Renamed put_pixel to set_pixel for consistency
Use more descriptive types in binary pattern matching