@umituz/react-native-ai-generation-content 1.17.232 → 1.17.233
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +236 -261
- package/package.json +1 -1
- package/src/domains/content-moderation/README.md +239 -296
- package/src/domains/creations/README.md +242 -325
- package/src/domains/face-detection/README.md +228 -307
- package/src/domains/prompts/README.md +242 -312
- package/src/features/ai-hug/README.md +381 -219
- package/src/features/ai-kiss/README.md +388 -219
- package/src/features/anime-selfie/README.md +327 -256
- package/src/features/audio-generation/README.md +352 -309
- package/src/features/colorization/README.md +332 -228
- package/src/features/couple-future/README.md +387 -212
- package/src/features/future-prediction/README.md +391 -221
- package/src/features/hd-touch-up/README.md +339 -252
- package/src/features/image-captioning/README.md +359 -299
- package/src/features/image-to-image/README.md +398 -357
- package/src/features/image-to-video/README.md +337 -292
- package/src/features/inpainting/README.md +348 -244
- package/src/features/meme-generator/README.md +350 -269
- package/src/features/remove-background/README.md +335 -234
- package/src/features/remove-object/README.md +341 -288
- package/src/features/replace-background/README.md +353 -236
- package/src/features/script-generator/README.md +358 -287
- package/src/features/shared/README.md +254 -223
- package/src/features/sketch-to-image/README.md +331 -234
- package/src/features/style-transfer/README.md +336 -237
- package/src/features/text-to-video/README.md +360 -193
- package/src/features/text-to-voice/README.md +382 -272
|
@@ -1,352 +1,405 @@
|
|
|
1
|
-
# Remove Object
|
|
1
|
+
# Remove Object Feature
|
|
2
2
|
|
|
3
3
|
Remove unwanted objects from images using AI.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📍 Import Path
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Support for multiple objects
|
|
11
|
-
- Natural-looking results
|
|
7
|
+
```typescript
|
|
8
|
+
import { useRemoveObjectFeature } from '@umituz/react-native-ai-generation-content';
|
|
9
|
+
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
**Location**: `src/features/remove-object/`
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## 🎯 Feature Purpose
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
npm install @umituz/react-native-ai-generation-content
|
|
19
|
-
```
|
|
15
|
+
Intelligently remove unwanted objects from photos with automatic background reconstruction. Uses AI to fill in the removed area with natural-looking content that matches the surroundings.
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
---
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
## 📋 Usage Strategy
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
import { useRemoveObjectFeature } from '@umituz/react-native-ai-generation-content';
|
|
27
|
-
import * as ImagePicker from 'react-native-image-picker';
|
|
28
|
-
|
|
29
|
-
function RemoveObjectScreen() {
|
|
30
|
-
const [image, setImage] = useState<string | null>(null);
|
|
31
|
-
const [mask, setMask] = useState<string | null>(null);
|
|
32
|
-
|
|
33
|
-
const feature = useRemoveObjectFeature({
|
|
34
|
-
config: {
|
|
35
|
-
onProcessingStart: () => console.log('Removing object...'),
|
|
36
|
-
onProcessingComplete: (result) => console.log('Complete:', result),
|
|
37
|
-
onError: (error) => console.error('Error:', error),
|
|
38
|
-
},
|
|
39
|
-
onSelectImage: async () => {
|
|
40
|
-
const result = await ImagePicker.launchImageLibrary({ mediaType: 'photo' });
|
|
41
|
-
if (result.assets && result.assets[0].uri) {
|
|
42
|
-
const base64 = await convertToBase64(result.assets[0].uri);
|
|
43
|
-
setImage(base64);
|
|
44
|
-
return base64;
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
},
|
|
48
|
-
onCreateMask: async () => {
|
|
49
|
-
// User paints over the object to remove
|
|
50
|
-
const maskImage = await paintMaskOverImage(image);
|
|
51
|
-
setMask(maskImage);
|
|
52
|
-
return maskImage;
|
|
53
|
-
},
|
|
54
|
-
onSaveResult: async (imageUrl) => {
|
|
55
|
-
await saveToGallery(imageUrl);
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<View>
|
|
61
|
-
<PhotoUploadCard
|
|
62
|
-
image={image}
|
|
63
|
-
onSelectImage={feature.selectImage}
|
|
64
|
-
title="Select Image with Object to Remove"
|
|
65
|
-
/>
|
|
66
|
-
|
|
67
|
-
<MaskEditor
|
|
68
|
-
image={image}
|
|
69
|
-
mask={mask}
|
|
70
|
-
onMaskCreated={feature.createMask}
|
|
71
|
-
/>
|
|
72
|
-
|
|
73
|
-
<Button
|
|
74
|
-
title="Remove Object"
|
|
75
|
-
onPress={feature.process}
|
|
76
|
-
disabled={!feature.isReady || feature.state.isProcessing}
|
|
77
|
-
/>
|
|
78
|
-
|
|
79
|
-
{feature.state.isProcessing && (
|
|
80
|
-
<View>
|
|
81
|
-
<Text>Removing object...</Text>
|
|
82
|
-
<ProgressBar progress={feature.state.progress} />
|
|
83
|
-
</View>
|
|
84
|
-
)}
|
|
85
|
-
|
|
86
|
-
{feature.state.result && (
|
|
87
|
-
<ResultDisplay
|
|
88
|
-
originalImage={image}
|
|
89
|
-
resultImage={feature.state.result.imageUrl}
|
|
90
|
-
onSave={() => feature.saveResult()}
|
|
91
|
-
/>
|
|
92
|
-
)}
|
|
93
|
-
</View>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
```
|
|
21
|
+
### When to Use This Feature
|
|
97
22
|
|
|
98
|
-
|
|
23
|
+
✅ **Use Cases:**
|
|
24
|
+
- Removing photobombers from photos
|
|
25
|
+
- Cleaning up distracting elements
|
|
26
|
+
- Removing text, logos, or watermarks
|
|
27
|
+
- Eliminating trash or signs from nature photos
|
|
28
|
+
- Removing unwanted objects from backgrounds
|
|
99
29
|
|
|
100
|
-
|
|
101
|
-
|
|
30
|
+
❌ **When NOT to Use:**
|
|
31
|
+
- Background removal (use Remove Background)
|
|
32
|
+
- Filling missing areas (use Inpainting)
|
|
33
|
+
- Photo restoration (use Photo Restoration)
|
|
34
|
+
- Replacing background (use Replace Background)
|
|
102
35
|
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
<AIFeatureScreen
|
|
106
|
-
featureId="remove-object"
|
|
107
|
-
userId="user-123"
|
|
108
|
-
/>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
```
|
|
36
|
+
### Implementation Strategy
|
|
112
37
|
|
|
113
|
-
|
|
38
|
+
1. **Select image** with unwanted objects
|
|
39
|
+
2. **Create mask** by painting over objects to remove
|
|
40
|
+
3. **Choose fill method** (smart, blur, color)
|
|
41
|
+
4. **Configure options** (edge feathering, context preservation)
|
|
42
|
+
5. **Process removal** with progress tracking
|
|
43
|
+
6. **Preview and compare** with original
|
|
44
|
+
7. **Save or adjust** result
|
|
114
45
|
|
|
115
|
-
|
|
46
|
+
---
|
|
116
47
|
|
|
117
|
-
|
|
118
|
-
interface RemoveObjectFeatureConfig {
|
|
119
|
-
fillMethod?: 'smart' | 'blur' | 'color'; // How to fill the removed area
|
|
120
|
-
onProcessingStart?: () => void;
|
|
121
|
-
onProcessingComplete?: (result: RemoveObjectResult) => void;
|
|
122
|
-
onError?: (error: string) => void;
|
|
123
|
-
}
|
|
124
|
-
```
|
|
48
|
+
## ⚠️ Critical Rules (MUST FOLLOW)
|
|
125
49
|
|
|
126
|
-
###
|
|
50
|
+
### 1. Image Requirements
|
|
51
|
+
- **MUST** provide ONE image with objects to remove
|
|
52
|
+
- **MUST** use high-quality images (min 512x512 recommended)
|
|
53
|
+
- **MUST** have clear, visible objects to remove
|
|
54
|
+
- **MUST NOT** exceed file size limits (10MB max)
|
|
55
|
+
- **MUST** create accurate mask for objects
|
|
127
56
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
```
|
|
57
|
+
### 2. Mask Requirements
|
|
58
|
+
- **MUST** provide valid mask image
|
|
59
|
+
- **MUST** paint mask completely over objects
|
|
60
|
+
- **MUST** ensure mask covers entire object
|
|
61
|
+
- **MUST** include mask creation interface
|
|
62
|
+
- **MUST** validate mask before processing
|
|
136
63
|
|
|
137
|
-
|
|
64
|
+
### 3. Configuration
|
|
65
|
+
- **MUST** provide valid `userId` for tracking
|
|
66
|
+
- **MUST** specify `fillMethod` (smart, blur, color)
|
|
67
|
+
- **MUST** implement `onError` callback
|
|
68
|
+
- **MUST** implement `onSelectImage` callback
|
|
69
|
+
- **MUST** implement `onCreateMask` callback
|
|
138
70
|
|
|
139
|
-
###
|
|
71
|
+
### 4. State Management
|
|
72
|
+
- **MUST** check `isReady` before enabling remove button
|
|
73
|
+
- **MUST** verify both image and mask are provided
|
|
74
|
+
- **MUST** display progress during removal
|
|
75
|
+
- **MUST** display `error` state with clear messages
|
|
76
|
+
- **MUST** implement proper cleanup on unmount
|
|
140
77
|
|
|
141
|
-
|
|
78
|
+
### 5. Performance
|
|
79
|
+
- **MUST** implement image compression before upload
|
|
80
|
+
- **MUST** show progress indicator for processing
|
|
81
|
+
- **MUST** cache results locally
|
|
82
|
+
- **MUST** allow users to cancel processing
|
|
83
|
+
- **MUST NOT** remove multiple objects simultaneously (combine masks)
|
|
142
84
|
|
|
143
|
-
|
|
144
|
-
const result = await feature.process({
|
|
145
|
-
mask: maskImage,
|
|
146
|
-
fillMethod: 'smart',
|
|
147
|
-
preserveContext: true,
|
|
148
|
-
});
|
|
149
|
-
```
|
|
85
|
+
---
|
|
150
86
|
|
|
151
|
-
|
|
87
|
+
## 🚫 Prohibitions (MUST AVOID)
|
|
152
88
|
|
|
153
|
-
|
|
89
|
+
### Strictly Forbidden
|
|
154
90
|
|
|
155
|
-
|
|
156
|
-
const result = await feature.process({
|
|
157
|
-
mask: maskImage,
|
|
158
|
-
fillMethod: 'blur',
|
|
159
|
-
featherEdges: true,
|
|
160
|
-
});
|
|
161
|
-
```
|
|
91
|
+
❌ **NEVER** do the following:
|
|
162
92
|
|
|
163
|
-
|
|
93
|
+
1. **No Missing Mask**
|
|
94
|
+
- Always validate mask is created
|
|
95
|
+
- Never call process() without mask
|
|
164
96
|
|
|
165
|
-
|
|
97
|
+
2. **No Auto-Processing**
|
|
98
|
+
- Never start removal without user action
|
|
99
|
+
- Always require explicit "Remove" button press
|
|
100
|
+
- Show mask preview before processing
|
|
166
101
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
fillMethod: 'color',
|
|
171
|
-
featherEdges: true,
|
|
172
|
-
});
|
|
173
|
-
```
|
|
102
|
+
3. **No Hardcoded Credentials**
|
|
103
|
+
- Never store API keys in component files
|
|
104
|
+
- Use environment variables or secure storage
|
|
174
105
|
|
|
175
|
-
|
|
106
|
+
4. **No Unhandled Errors**
|
|
107
|
+
- Never ignore removal failures
|
|
108
|
+
- Always explain what went wrong
|
|
109
|
+
- Provide retry or alternative options
|
|
176
110
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
5. View Result - See the cleaned image
|
|
182
|
-
6. Save or Edit - Save or make further adjustments
|
|
111
|
+
5. **No Memory Leaks**
|
|
112
|
+
- Never store both original and result simultaneously
|
|
113
|
+
- Clean up temporary mask images
|
|
114
|
+
- Implement proper image disposal
|
|
183
115
|
|
|
184
|
-
|
|
116
|
+
6. **No Blocked UI**
|
|
117
|
+
- Never block main thread with mask processing
|
|
118
|
+
- Always show progress indicator
|
|
119
|
+
- Allow cancellation
|
|
185
120
|
|
|
186
|
-
|
|
121
|
+
7. **No Incomplete Masking**
|
|
122
|
+
- Never use partial masks that don't cover entire object
|
|
123
|
+
- Always provide tools for complete object coverage
|
|
124
|
+
- Allow mask adjustment before processing
|
|
187
125
|
|
|
188
|
-
|
|
189
|
-
import { GridSelector } from '@umituz/react-native-ai-generation-content';
|
|
126
|
+
---
|
|
190
127
|
|
|
191
|
-
|
|
192
|
-
{ id: 'smart', name: 'Smart Fill', description: 'AI reconstruction' },
|
|
193
|
-
{ id: 'blur', name: 'Blur', description: 'Blurred fill' },
|
|
194
|
-
{ id: 'color', name: 'Color', description: 'Solid color fill' },
|
|
195
|
-
];
|
|
128
|
+
## 🤖 AI Agent Directions
|
|
196
129
|
|
|
197
|
-
|
|
198
|
-
options={fillMethods}
|
|
199
|
-
selectedOption={selectedMethod}
|
|
200
|
-
onSelectOption={setSelectedMethod}
|
|
201
|
-
/>
|
|
202
|
-
```
|
|
130
|
+
### For AI Code Generation Tools
|
|
203
131
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
132
|
+
When using this feature with AI code generation tools, follow these guidelines:
|
|
133
|
+
|
|
134
|
+
#### Prompt Template for AI Agents
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
You are implementing a remove object feature using @umituz/react-native-ai-generation-content.
|
|
138
|
+
|
|
139
|
+
REQUIREMENTS:
|
|
140
|
+
1. Import from: @umituz/react-native-ai-generation-content
|
|
141
|
+
2. Use the useRemoveObjectFeature hook
|
|
142
|
+
3. Implement image selection UI
|
|
143
|
+
4. Implement mask creation UI with drawing tools
|
|
144
|
+
5. Select fill method (smart, blur, color)
|
|
145
|
+
6. Configure options (featherEdges, preserveContext)
|
|
146
|
+
7. Validate both image and mask before processing
|
|
147
|
+
8. Show before/after comparison
|
|
148
|
+
9. Handle long processing times with progress
|
|
149
|
+
10. Implement proper error handling
|
|
150
|
+
11. Implement cleanup on unmount
|
|
151
|
+
|
|
152
|
+
CRITICAL RULES:
|
|
153
|
+
- MUST validate both image and mask before calling process()
|
|
154
|
+
- MUST provide mask drawing/creation interface
|
|
155
|
+
- MUST show before/after comparison
|
|
156
|
+
- MUST handle fill method selection
|
|
157
|
+
- MUST implement debouncing (300ms)
|
|
158
|
+
- MUST allow multiple removal attempts
|
|
159
|
+
|
|
160
|
+
CONFIGURATION:
|
|
161
|
+
- Provide valid userId (string)
|
|
162
|
+
- Set fillMethod: 'smart' | 'blur' | 'color'
|
|
163
|
+
- Set featherEdges: boolean (soften edges)
|
|
164
|
+
- Set preserveContext: boolean (maintain surroundings)
|
|
165
|
+
- Implement onSelectImage callback
|
|
166
|
+
- Implement onCreateMask callback
|
|
167
|
+
- Implement onSaveResult callback
|
|
168
|
+
- Configure callbacks: onProcessingStart, onProcessingComplete, onError
|
|
169
|
+
|
|
170
|
+
FILL METHODS:
|
|
171
|
+
- smart: AI-powered intelligent reconstruction (recommended)
|
|
172
|
+
- blur: Blur and blend surrounding area
|
|
173
|
+
- color: Fill with average surrounding color
|
|
174
|
+
|
|
175
|
+
OPTIONS:
|
|
176
|
+
- featherEdges: Soften edges for natural look (default: true)
|
|
177
|
+
- preserveContext: Maintain surrounding context (default: true)
|
|
178
|
+
|
|
179
|
+
STRICTLY FORBIDDEN:
|
|
180
|
+
- No missing mask validation
|
|
181
|
+
- No auto-processing without user action
|
|
182
|
+
- No hardcoded API keys
|
|
183
|
+
- No unhandled errors
|
|
184
|
+
- No memory leaks
|
|
185
|
+
- No blocking UI
|
|
186
|
+
- No incomplete masking
|
|
187
|
+
|
|
188
|
+
QUALITY CHECKLIST:
|
|
189
|
+
- [ ] Image selection implemented
|
|
190
|
+
- [ ] Mask creation/drawing interface added
|
|
191
|
+
- [ ] Fill method selector included
|
|
192
|
+
- [ ] Mask validation before processing
|
|
193
|
+
- [ ] Before/after comparison view
|
|
194
|
+
- [ ] Progress indicator during processing
|
|
195
|
+
- [ ] Error display with retry option
|
|
196
|
+
- [ ] Download/share functionality
|
|
197
|
+
- [ ] Multiple removal attempts supported
|
|
232
198
|
```
|
|
233
199
|
|
|
234
|
-
|
|
200
|
+
#### AI Implementation Checklist
|
|
235
201
|
|
|
236
|
-
|
|
237
|
-
import { ResultDisplay } from '@umituz/react-native-ai-generation-content';
|
|
202
|
+
Use this checklist when generating code:
|
|
238
203
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
204
|
+
- [ ] Feature imported from correct path
|
|
205
|
+
- [ ] Image selection implemented
|
|
206
|
+
- [ ] Mask drawing interface implemented
|
|
207
|
+
- [ ] Fill method selector added
|
|
208
|
+
- [ ] Validation before process() (image + mask)
|
|
209
|
+
- [ ] Before/after comparison view
|
|
210
|
+
- [ ] Progress indicator during processing
|
|
211
|
+
- [ ] Error display with user-friendly message
|
|
212
|
+
- [ ] Download/share buttons
|
|
213
|
+
- [ ] Multiple removal attempts option
|
|
214
|
+
- [ ] Cleanup on unmount
|
|
215
|
+
- [ ] Original image preserved
|
|
248
216
|
|
|
249
|
-
|
|
217
|
+
---
|
|
250
218
|
|
|
251
|
-
|
|
219
|
+
## 🛠️ Configuration Strategy
|
|
252
220
|
|
|
253
|
-
|
|
254
|
-
// Remove unwanted people from photos
|
|
255
|
-
const result = await feature.process({
|
|
256
|
-
mask: photobomberMask,
|
|
257
|
-
fillMethod: 'smart',
|
|
258
|
-
});
|
|
259
|
-
```
|
|
221
|
+
### Essential Configuration
|
|
260
222
|
|
|
261
|
-
|
|
223
|
+
```typescript
|
|
224
|
+
// Required fields
|
|
225
|
+
{
|
|
226
|
+
userId: string
|
|
227
|
+
fillMethod: 'smart' | 'blur' | 'color'
|
|
228
|
+
onSelectImage: () => Promise<string | null>
|
|
229
|
+
onCreateMask: () => Promise<string | null>
|
|
230
|
+
}
|
|
262
231
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
});
|
|
232
|
+
// Optional callbacks
|
|
233
|
+
{
|
|
234
|
+
onProcessingStart?: () => void
|
|
235
|
+
onProcessingComplete?: (result) => void
|
|
236
|
+
onError?: (error: string) => void
|
|
237
|
+
}
|
|
270
238
|
```
|
|
271
239
|
|
|
272
|
-
###
|
|
240
|
+
### Recommended Settings
|
|
273
241
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
fillMethod: 'blur',
|
|
279
|
-
featherEdges: true,
|
|
280
|
-
});
|
|
281
|
-
```
|
|
242
|
+
1. **Fill Methods**
|
|
243
|
+
- Smart: AI-powered intelligent reconstruction (recommended for most cases)
|
|
244
|
+
- Blur: Blurred fill for simple backgrounds
|
|
245
|
+
- Color: Solid color fill for uniform areas
|
|
282
246
|
|
|
283
|
-
|
|
247
|
+
2. **Options**
|
|
248
|
+
- featherEdges: Soften edges for natural look (default: true)
|
|
249
|
+
- preserveContext: Maintain surrounding context (default: true)
|
|
284
250
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
});
|
|
291
|
-
```
|
|
251
|
+
3. **Image Quality**
|
|
252
|
+
- Minimum: 512x512 resolution
|
|
253
|
+
- Recommended: 1024x1024 or higher
|
|
254
|
+
- Format: JPEG or PNG
|
|
255
|
+
- Max size: 10MB
|
|
292
256
|
|
|
293
|
-
|
|
257
|
+
4. **Mask Quality**
|
|
258
|
+
- Complete coverage of object
|
|
259
|
+
- Slight margin around object edges
|
|
260
|
+
- Semi-transparent for preview
|
|
294
261
|
|
|
295
|
-
|
|
296
|
-
2. **Fill Method**: Use Smart Fill for most natural results
|
|
297
|
-
4. **Simple Backgrounds**: Easier removal from simple backgrounds
|
|
298
|
-
5. **Context Preservation**: Enable for objects near important elements
|
|
299
|
-
6. **Multiple Passes**: For difficult objects, try multiple approaches
|
|
262
|
+
---
|
|
300
263
|
|
|
301
|
-
##
|
|
264
|
+
## 📊 State Management
|
|
302
265
|
|
|
303
|
-
###
|
|
266
|
+
### Feature States
|
|
304
267
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
268
|
+
**isReady**: boolean
|
|
269
|
+
- Image selected and mask created
|
|
270
|
+
- Check before enabling remove button
|
|
271
|
+
|
|
272
|
+
**isProcessing**: boolean
|
|
273
|
+
- Object removal in progress
|
|
274
|
+
- Show loading/progress indicator
|
|
275
|
+
- Disable remove button
|
|
313
276
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
fillMethod: 'smart',
|
|
328
|
-
});
|
|
277
|
+
**progress**: number (0-100)
|
|
278
|
+
- Removal progress percentage
|
|
279
|
+
- Update progress bar
|
|
280
|
+
|
|
281
|
+
**error**: string | null
|
|
282
|
+
- Error message if removal failed
|
|
283
|
+
- Display to user with clear message
|
|
284
|
+
|
|
285
|
+
**result**: {
|
|
286
|
+
imageUrl: string
|
|
287
|
+
originalImageUrl?: string
|
|
288
|
+
fillMethod?: string
|
|
289
|
+
metadata?: any
|
|
329
290
|
}
|
|
330
|
-
```
|
|
331
291
|
|
|
332
|
-
|
|
292
|
+
---
|
|
333
293
|
|
|
334
|
-
|
|
335
|
-
const { state, process } = useRemoveObjectFeature({ ...config });
|
|
294
|
+
## 🎨 Best Practices
|
|
336
295
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
296
|
+
### Mask Creation
|
|
297
|
+
|
|
298
|
+
1. **Object Coverage**
|
|
299
|
+
- Good: Complete coverage with slight margin
|
|
300
|
+
- Bad: Incomplete coverage, missing edges
|
|
301
|
+
|
|
302
|
+
2. **Background Complexity**
|
|
303
|
+
- Simple backgrounds: Easier removal
|
|
304
|
+
- Complex backgrounds: May require multiple attempts
|
|
305
|
+
- Smart fill works best for most cases
|
|
306
|
+
|
|
307
|
+
3. **Multiple Objects**
|
|
308
|
+
- Combine multiple objects into single mask
|
|
309
|
+
- Process all at once for consistency
|
|
310
|
+
|
|
311
|
+
### User Experience
|
|
312
|
+
|
|
313
|
+
1. **Mask Drawing Tools**
|
|
314
|
+
- Adjustable brush size
|
|
315
|
+
- Eraser for corrections
|
|
316
|
+
- Undo/redo support
|
|
317
|
+
- Zoom for precision
|
|
318
|
+
|
|
319
|
+
2. **Preview**
|
|
320
|
+
- Show mask overlay before processing
|
|
321
|
+
- Allow mask adjustments
|
|
322
|
+
- Preview fill method settings
|
|
323
|
+
|
|
324
|
+
3. **Before/After Comparison**
|
|
325
|
+
- Side-by-side comparison
|
|
326
|
+
- Slider for easy comparison
|
|
327
|
+
- Zoom for detail inspection
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## 🐛 Common Pitfalls
|
|
332
|
+
|
|
333
|
+
### Mask Issues
|
|
334
|
+
|
|
335
|
+
❌ **Problem**: Object not fully removed
|
|
336
|
+
✅ **Solution**: Ensure mask covers entire object completely
|
|
337
|
+
|
|
338
|
+
### Background Issues
|
|
339
|
+
|
|
340
|
+
❌ **Problem**: Unnatural looking fill
|
|
341
|
+
✅ **Solution**: Try smart fill, enable context preservation
|
|
342
|
+
|
|
343
|
+
### Edge Issues
|
|
344
|
+
|
|
345
|
+
❌ **Problem**: Visible edges around removed area
|
|
346
|
+
✅ **Solution**: Enable edge feathering, improve mask precision
|
|
347
|
+
|
|
348
|
+
### Complex Objects
|
|
349
|
+
|
|
350
|
+
❌ **Problem**: Difficult to remove complex objects
|
|
351
|
+
✅ **Solution**: Use smart fill, may require multiple attempts
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## 📦 Related Components
|
|
356
|
+
|
|
357
|
+
Use these components from the library:
|
|
358
|
+
|
|
359
|
+
- **PhotoUploadCard**: Upload image interface
|
|
360
|
+
- **MaskEditor**: Create mask with drawing tools
|
|
361
|
+
- **FillMethodSelector**: Choose fill strategy
|
|
362
|
+
- **ResultDisplay**: Before/after comparison
|
|
363
|
+
- **ProgressBar**: Progress display
|
|
364
|
+
|
|
365
|
+
Located at: `src/presentation/components/`
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## 🔄 Migration Strategy
|
|
370
|
+
|
|
371
|
+
If migrating from previous implementation:
|
|
372
|
+
|
|
373
|
+
1. **Update imports** to new path
|
|
374
|
+
2. **Add mask creation interface**
|
|
375
|
+
3. **Implement fill method selector**
|
|
376
|
+
4. **Update state handling** for new structure
|
|
377
|
+
5. **Add before/after comparison**
|
|
378
|
+
6. **Test all fill methods**
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## 📚 Additional Resources
|
|
383
|
+
|
|
384
|
+
- Main documentation: `/docs/`
|
|
385
|
+
- API reference: `/docs/api/`
|
|
386
|
+
- Examples: `/docs/examples/basic/remove-object/`
|
|
387
|
+
- Architecture: `/ARCHITECTURE.md`
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
**Last Updated**: 2025-01-08
|
|
392
|
+
**Version**: 2.0.0 (Strategy-based Documentation)
|
|
343
393
|
|
|
344
|
-
|
|
394
|
+
---
|
|
345
395
|
|
|
346
|
-
|
|
347
|
-
- [Inpainting](../inpainting) - Fill in missing parts of images
|
|
348
|
-
- [Replace Background](../replace-background) - Replace with new background
|
|
396
|
+
## 📝 Changelog
|
|
349
397
|
|
|
350
|
-
|
|
398
|
+
### v2.0.0 - 2025-01-08
|
|
399
|
+
- **BREAKING**: Documentation format changed to strategy-based
|
|
400
|
+
- Removed extensive code examples
|
|
401
|
+
- Added rules, prohibitions, and AI agent directions
|
|
402
|
+
- Focus on best practices and implementation guidance
|
|
351
403
|
|
|
352
|
-
|
|
404
|
+
### v1.0.0 - Initial Release
|
|
405
|
+
- Initial feature documentation
|