๐ผ๏ธ Documentation Image Organization
A guide to working with images in the KDP documentation
Overview
KDP documentation uses a section-specific image organization pattern where each documentation section has its own imgs/ directory containing relevant images. This approach provides better organization and makes it clear which images are used in each section.
๐ Directory Structure
Each major documentation section has its own imgs/ directory:
docs/
โโโ features/
โ   โโโ imgs/             # Feature-specific images
โ   โ   โโโ models/       # Generated model diagrams
โ   โโโ overview.md
โ   โโโ ...
โโโ advanced/
โ   โโโ imgs/             # Advanced feature images
โ   โโโ ...
โโโ getting-started/
โ   โโโ imgs/             # Getting started images
โ   โโโ ...
โโโ ...
๐ Image Organization Script
The scripts/organize_docs_images.sh script handles image organization:
- It categorizes images into common, feature-specific, and advanced types
 - It distributes these images to appropriate section folders
 - It ensures generated model diagrams are correctly placed in the 
features/imgs/models/directory 
This script runs automatically during documentation generation:
make generate_doc_content
๐จ Image Categories
Images are organized into three main categories:
- Common Images (distributed to all sections):
 Model_Architecture.png- Main architecture diagramfeatures_stats.png- Feature statistics visualizationtime_vs_nr_data.png- Performance comparison charttime_vs_nr_features.png- Feature scaling chart- 
kdp_logo.png- Project logo - 
Feature-Specific Images (in
features/imgs/andgetting-started/imgs/): cat_feature_pipeline.png- Categorical feature processing pipelinenumerical_example_model.png- Example numerical feature model- 
And others related to core feature types
 - 
Advanced Feature Images (in
advanced/imgs/,optimization/imgs/, andexamples/imgs/): TransformerBlockAllFeatures.png- Transformer block architecturenumerical_example_model_with_distribution_aware.png- Distribution-aware encoding- 
And others related to advanced features
 - 
Model Diagrams (in
features/imgs/models/): - Automatically generated diagrams showing different model architectures
 - Created by the 
generate_model_diagrams.pyscript 
๐๏ธ Adding New Images
When adding new images to the documentation:
- Place the image in the appropriate section's 
imgs/directory - Reference it in the Markdown using a relative path: 
 - Run 
make generate_doc_contentto ensure proper organization 
๐ Best Practices
- Use Descriptive Filenames:
 - Choose clear, descriptive names: 
categorical_processing_flow.pngnotimg1.png - 
Use snake_case for filenames
 - 
Optimize Images:
 - Compress images to reduce file size
 - Use PNG for diagrams and screenshots
 - 
Keep dimensions reasonable (800-1200px width for most images)
 - 
Include Alt Text:
 - 
Always provide descriptive alt text:
 - 
Keep Images Relevant:
 - Only include images that add value to the documentation
 - Remove unused images using 
make clean_old_diagrams 
๐ Finding Unused Images
To identify potentially unused images:
make identify_unused_diagrams
This will generate an unused_diagrams_report.txt file listing images that may not be referenced in the documentation.