How cpp7957/nm works
Main components
a. Data Source (External Service)
• Google Image Search (via HTTP requests)
b. Crawling Module (crawling.py)
• HTTP client (requests)
• HTML parser (BeautifulSoup)
• Download manager (file I/O, tqdm for progress)
c. Local Storage
• noh_images/ folder (raw images)
• 노무현.jpg (reference image)
• noh_mosaic.jpg (output)
d. Mosaic Module (mosaic.py)
• Image loader (Pillow)
• Tile processor (resize to TILE_SIZE)
• Grid assembler (BUILD grid of size GRID_SIZE)
e. Output
• Final mosaic image saved to disk
Relationships and data flow
• Crawling Module → Local Storage (save images to noh_images/)
• Local Storage (noh_images/ + 노무현.jpg) → Mosaic Module (load inputs)
• Mosaic Module → Local Storage (noh_mosaic.jpg)
• (Optionally) show libraries as subcomponents of each module
Architectural patterns / design principles
• Pipeline pattern: two sequential stages (Crawl → Process)
• Separation of concerns: crawling and processing live in separate scripts
• Dependency injection (via constants in mosaic.py for TILE_SIZE, GRID_SIZE)
• Reusability: using standard libraries (requests, BeautifulSoup, Pillow, NumPy)
Technologies
• Python 3
• requests, beautifulsoup4, pillow, numpy, tqdm
• HTTP/HTTPS for external communication
• File system for storage