summaryrefslogtreecommitdiff
path: root/training/README.md
blob: 08379eeada942f8bf0c3c533f88e6c0ba6b79a74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Image Style Processor

A comprehensive Python script that applies artistic hand-drawn and futuristic effects to images.

## Requirements

- Python 3
- OpenCV (cv2)
- NumPy

Install dependencies:
```bash
pip install opencv-python numpy
```

## Usage

```bash
python3 image_style_processor.py <input_directory> <output_directory> <style>
```

### Arguments

- `input_directory`: Directory containing your input images (PNG, JPG, JPEG)
- `output_directory`: Directory where processed images will be saved (created if doesn't exist)
- `style`: The artistic style to apply (see below)

## Available Styles

### Sketch Styles

1. **pencil_sketch** - Dense cross-hatching with progressive layers in shadows
   - Best for: Detailed technical drawings, architectural scenes
   - Features: Clean line art, 5 layers of cross-hatching, strong shadow definition

2. **ink_drawing** - Bold black outlines with comic book aesthetic
   - Best for: Graphic novel style, high contrast scenes
   - Features: Bold outlines, posterized tones, minimal shading

3. **charcoal_pastel** - Dramatic contrasts with soft, smudged textures
   - Best for: Portraits, dramatic landscapes
   - Features: Soft blending, grainy texture, highlighted areas

4. **conte_crayon** - Directional strokes following image contours
   - Best for: Figure studies, natural forms
   - Features: Stroke direction follows gradients, cross-hatching in dark areas

5. **gesture_sketch** - Loose, quick observational sketch style
   - Best for: Quick studies, energetic compositions
   - Features: Randomized line wobble, sparse suggestion lines

### Futuristic Styles

6. **circuit_board** - Tech blueprint with circuit paths and geometric patterns
   - Best for: Sci-fi imagery, technological themes
   - Features: Multi-layer circuit paths, connection nodes, technical grid overlay

7. **glitch_art** - Digital corruption with scan line shifts and pixel sorting
   - Best for: Cyberpunk aesthetics, digital art
   - Features: Horizontal scan artifacts, block displacement, pixel sorting, noise strips

8. **wireframe_topo** - Topographic contour lines with holographic grid
   - Best for: Landscape, abstract patterns, sci-fi hologram effect
   - Features: 20 contour levels, scan lines, measurement markers, grid overlay

9. **data_mosaic** - Voronoi geometric fragmentation with angular cells
   - Best for: Abstract art, geometric compositions
   - Features: 200 Voronoi cells, posterized tones, embedded geometric patterns

10. **holographic_scan** - CRT/hologram display with scanlines and HUD elements
    - Best for: Retro-futuristic, heads-up display aesthetic
    - Features: Scanlines, interference patterns, glitch effects, corner brackets, crosshair

## Examples

### Sketch Effects

Process images with pencil sketch:
```bash
python3 image_style_processor.py ./photos ./output pencil_sketch
```

Apply ink drawing style:
```bash
python3 image_style_processor.py ./input ./sketches ink_drawing
```

Create charcoal effect:
```bash
python3 image_style_processor.py ./images ./results charcoal_pastel
```

### Futuristic Effects

Apply circuit board style:
```bash
python3 image_style_processor.py ./photos ./output circuit_board
```

Create glitch art:
```bash
python3 image_style_processor.py ./input ./glitched glitch_art
```

Apply holographic effect:
```bash
python3 image_style_processor.py ./images ./holo holographic_scan
```

## Output

- Processed images are saved to the output directory with **the same filename** as the input
- Supported input formats: PNG, JPG, JPEG (case-insensitive)
- Output format: PNG (preserves quality)
- Original images are never modified

## Style Comparison

### Sketch Styles
- **pencil_sketch**: Most detailed, traditional drawing look
- **ink_drawing**: Boldest, most graphic/comic-like
- **charcoal_pastel**: Softest, most artistic/painterly
- **conte_crayon**: Most directional, follows contours
- **gesture_sketch**: Loosest, most expressive

### Futuristic Styles
- **circuit_board**: Cleanest, most technical/blueprint-like
- **glitch_art**: Most chaotic, digital corruption aesthetic
- **wireframe_topo**: Most structured, topographic/hologram feel
- **data_mosaic**: Most geometric, fragmented cells
- **holographic_scan**: Most retro-futuristic, HUD/CRT display

## Tips

- Images are automatically converted to grayscale before processing
- All styles work best with high-resolution images (300+ DPI recommended)
- Processing time varies by style:
  - Fast: ink_drawing, glitch_art, holographic_scan
  - Medium: charcoal_pastel, gesture_sketch, circuit_board, wireframe_topo
  - Slow: pencil_sketch, conte_crayon, data_mosaic (due to intensive computation)
- For batch processing large collections, consider processing in smaller batches
- Randomized styles (glitch_art, gesture_sketch, data_mosaic) will produce slightly different results each run

## Technical Notes

### Randomization
Some styles use randomization for natural variation:
- **glitch_art**: Random scan line shifts, block positions
- **gesture_sketch**: Random line wobble, stroke placement
- **data_mosaic**: Random Voronoi cell centers
- **circuit_board**: Random pattern placement in dark regions
- **holographic_scan**: Random glitch line positions

### Processing Details
- **pencil_sketch**: Uses 5-level progressive cross-hatching algorithm
- **conte_crayon**: Follows Sobel gradients for directional strokes
- **wireframe_topo**: Generates 20 brightness-based contour levels
- **data_mosaic**: Creates 200 Voronoi cells via nearest-neighbor algorithm
- **holographic_scan**: Applies scanline patterns and interference waves

## License

Free to use and modify for any purpose.

## Version

Version 1.0 - Complete collection of 10 artistic styles (5 sketch + 5 futuristic)