apexify.js 4.9.27 → 4.9.30

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.
Files changed (32) hide show
  1. package/README.md +672 -377
  2. package/dist/cjs/Canvas/ApexPainter.d.ts.map +1 -1
  3. package/dist/cjs/Canvas/ApexPainter.js +169 -2
  4. package/dist/cjs/Canvas/ApexPainter.js.map +1 -1
  5. package/dist/cjs/Canvas/utils/Image/imageProperties.d.ts.map +1 -1
  6. package/dist/cjs/Canvas/utils/Image/imageProperties.js +181 -2
  7. package/dist/cjs/Canvas/utils/Image/imageProperties.js.map +1 -1
  8. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts +33 -0
  9. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -1
  10. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js +237 -32
  11. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -1
  12. package/dist/cjs/Canvas/utils/types.d.ts +50 -10
  13. package/dist/cjs/Canvas/utils/types.d.ts.map +1 -1
  14. package/dist/cjs/Canvas/utils/types.js.map +1 -1
  15. package/dist/esm/Canvas/ApexPainter.d.ts.map +1 -1
  16. package/dist/esm/Canvas/ApexPainter.js +169 -2
  17. package/dist/esm/Canvas/ApexPainter.js.map +1 -1
  18. package/dist/esm/Canvas/utils/Image/imageProperties.d.ts.map +1 -1
  19. package/dist/esm/Canvas/utils/Image/imageProperties.js +181 -2
  20. package/dist/esm/Canvas/utils/Image/imageProperties.js.map +1 -1
  21. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts +33 -0
  22. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -1
  23. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js +237 -32
  24. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -1
  25. package/dist/esm/Canvas/utils/types.d.ts +50 -10
  26. package/dist/esm/Canvas/utils/types.d.ts.map +1 -1
  27. package/dist/esm/Canvas/utils/types.js.map +1 -1
  28. package/lib/Canvas/ApexPainter.ts +192 -2
  29. package/lib/Canvas/utils/Image/imageProperties.ts +207 -2
  30. package/lib/Canvas/utils/Texts/enhancedTextRenderer.ts +274 -36
  31. package/lib/Canvas/utils/types.ts +52 -10
  32. package/package.json +1 -1
package/README.md CHANGED
@@ -1,377 +1,672 @@
1
- # 🎨 ApexPainter - Advanced Canvas Rendering Library
2
-
3
- <div align="center">
4
-
5
- ![ApexPainter Banner](apex-banner.png)
6
-
7
- **The Ultimate TypeScript Canvas Library for Node.js**
8
-
9
- [![npm version](https://badge.fury.io/js/apexify.svg)](https://badge.fury.io/js/apexify)
10
- [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)
11
- [![Node.js](https://img.shields.io/badge/Node.js-16%2B-green.svg)](https://nodejs.org/)
12
- [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
13
-
14
- *Create stunning visuals with professional-grade canvas rendering, image processing, and text effects*
15
-
16
- </div>
17
-
18
- ## ✨ Features Overview
19
-
20
- ### 🖼️ **Advanced Image Processing**
21
- - **Professional Filters**: 22+ filters including blur, sharpen, vintage, cinematic effects
22
- - **Shape Drawing**: 8+ shapes (rectangle, circle, heart, star, polygon, etc.)
23
- - **Gradient Support**: Linear and radial gradients for fills and strokes
24
- - **Shadow & Stroke Effects**: Customizable shadows and strokes for all shapes
25
- - **Rotation & Positioning**: Full control over image placement and rotation
26
-
27
- ### 🎨 **Rich Background System**
28
- - **Multiple Background Types**: Solid colors, gradients, custom images
29
- - **Pattern Overlays**: 12+ built-in patterns (grid, dots, stripes, hexagons, etc.)
30
- - **Custom Patterns**: Use your own images as repeating patterns
31
- - **Blend Modes**: 11+ blend modes for professional compositing
32
- - **Noise Effects**: Add texture with customizable noise intensity
33
-
34
- ### 📝 **Enhanced Text Rendering**
35
- - **Font Management**: Custom fonts, sizes, families, and styles
36
- - **Text Decorations**: Bold, italic, underline, overline, strikethrough, highlight
37
- - **Advanced Effects**: Glow, shadow, stroke with gradient support
38
- - **Spacing Control**: Letter spacing, word spacing, line height
39
- - **Text Wrapping**: Automatic text wrapping with size constraints
40
- - **Rotation**: Full 360° text rotation support
41
-
42
- ### 🔧 **Professional Tools**
43
- - **Chart Generation**: Bar charts, pie charts, line charts
44
- - **GIF Creation**: Animated GIFs from image sequences
45
- - **Format Conversion**: Convert between PNG, JPEG, WebP, and more
46
- - **Image Manipulation**: Crop, resize, background removal
47
- - **Color Detection**: Extract and analyze colors from images
48
-
49
- ---
50
-
51
- ## 🚀 Quick Start
52
-
53
- ### Installation
54
-
55
- ```bash
56
- npm install apexify
57
- ```
58
-
59
- ### Basic Usage
60
-
61
- ```typescript
62
- import { ApexPainter } from 'apexify';
63
-
64
- const painter = new ApexPainter();
65
-
66
- // Create a canvas with gradient background
67
- const canvas = await painter.createCanvas({
68
- width: 800,
69
- height: 600,
70
- gradientBg: {
71
- type: 'linear',
72
- colors: [
73
- { color: '#FF6B6B', position: 0 },
74
- { color: '#4ECDC4', position: 0.5 },
75
- { color: '#45B7D1', position: 1 }
76
- ],
77
- direction: { x1: 0, y1: 0, x2: 800, y2: 600 }
78
- },
79
- shadow: {
80
- color: '#000',
81
- offsetX: 10,
82
- offsetY: 10,
83
- blur: 20
84
- },
85
- borderRadius: 20
86
- });
87
-
88
- // Add a beautiful heart shape
89
- const heartImage = await painter.createImage({
90
- source: 'heart',
91
- x: 300,
92
- y: 200,
93
- width: 200,
94
- height: 200,
95
- fill: true,
96
- gradient: {
97
- type: 'radial',
98
- colors: [
99
- { color: '#FF6B6B', position: 0 },
100
- { color: '#FF1744', position: 1 }
101
- ],
102
- center: { x: 100, y: 100 },
103
- radius: 100
104
- },
105
- shadow: {
106
- color: '#000',
107
- offsetX: 15,
108
- offsetY: 15,
109
- blur: 25
110
- },
111
- stroke: {
112
- color: '#FFF',
113
- width: 5
114
- }
115
- });
116
-
117
- // Add stunning text
118
- const textImage = await painter.createText({
119
- text: 'ApexPainter',
120
- x: 400,
121
- y: 450,
122
- fontSize: 48,
123
- fontFamily: 'Arial',
124
- bold: true,
125
- gradient: {
126
- type: 'linear',
127
- colors: [
128
- { color: '#FFD700', position: 0 },
129
- { color: '#FF6B6B', position: 1 }
130
- ],
131
- direction: { x1: 0, y1: 0, x2: 300, y2: 0 }
132
- },
133
- glow: {
134
- color: '#FFD700',
135
- intensity: 0.8,
136
- opacity: 0.9
137
- },
138
- shadow: {
139
- color: '#000',
140
- offsetX: 8,
141
- offsetY: 8,
142
- blur: 15
143
- },
144
- stroke: {
145
- color: '#FFF',
146
- width: 3
147
- }
148
- }, heartImage);
149
-
150
- // Save the result
151
- fs.writeFileSync('beautiful-artwork.png', textImage);
152
- ```
153
-
154
- ---
155
-
156
- ## 🎯 Real-World Examples
157
-
158
- ### 🏢 **Business Cards & Marketing Materials**
159
-
160
- ```typescript
161
- // Create a professional business card
162
- const businessCard = await painter.createCanvas({
163
- width: 400,
164
- height: 250,
165
- gradientBg: {
166
- type: 'linear',
167
- colors: [
168
- { color: '#2C3E50', position: 0 },
169
- { color: '#34495E', position: 1 }
170
- ],
171
- direction: { x1: 0, y1: 0, x2: 400, y2: 250 }
172
- },
173
- patternBg: {
174
- type: 'dots',
175
- color: '#FFF',
176
- opacity: 0.1,
177
- size: 5,
178
- spacing: 20
179
- }
180
- });
181
-
182
- // Add company logo (star shape)
183
- const logo = await painter.createImage({
184
- source: 'star',
185
- x: 50,
186
- y: 50,
187
- width: 60,
188
- height: 60,
189
- fill: true,
190
- color: '#FFD700',
191
- shadow: { color: '#000', offsetX: 3, offsetY: 3, blur: 8 }
192
- }, businessCard.buffer);
193
-
194
- // Add company name
195
- const companyText = await painter.createText({
196
- text: 'ACME Corp',
197
- x: 130,
198
- y: 80,
199
- fontSize: 24,
200
- fontFamily: 'Arial',
201
- bold: true,
202
- color: '#FFF',
203
- shadow: { color: '#000', offsetX: 2, offsetY: 2, blur: 4 }
204
- }, logo);
205
-
206
- // Add contact info
207
- const contactText = await painter.createText({
208
- text: 'john@acme.com\n+1 (555) 123-4567',
209
- x: 50,
210
- y: 150,
211
- fontSize: 14,
212
- fontFamily: 'Arial',
213
- color: '#BDC3C7',
214
- lineHeight: 1.5
215
- }, companyText);
216
- ```
217
-
218
- ### 🎮 **Game UI Elements**
219
-
220
- ```typescript
221
- // Create a game button
222
- const gameButton = await painter.createCanvas({
223
- width: 200,
224
- height: 60,
225
- gradientBg: {
226
- type: 'linear',
227
- colors: [
228
- { color: '#FF6B6B', position: 0 },
229
- { color: '#FF1744', position: 1 }
230
- ],
231
- direction: { x1: 0, y1: 0, x2: 200, y2: 60 }
232
- },
233
- shadow: {
234
- color: '#000',
235
- offsetX: 5,
236
- offsetY: 5,
237
- blur: 15
238
- },
239
- borderRadius: 30
240
- });
241
-
242
- // Add button text with glow effect
243
- const buttonText = await painter.createText({
244
- text: 'PLAY NOW',
245
- x: 100,
246
- y: 35,
247
- fontSize: 20,
248
- fontFamily: 'Arial',
249
- bold: true,
250
- color: '#FFF',
251
- textAlign: 'center',
252
- textBaseline: 'middle',
253
- glow: {
254
- color: '#FFD700',
255
- intensity: 0.6,
256
- opacity: 0.8
257
- },
258
- shadow: {
259
- color: '#000',
260
- offsetX: 2,
261
- offsetY: 2,
262
- blur: 4
263
- }
264
- }, gameButton.buffer);
265
- ```
266
-
267
- ---
268
-
269
- ## 📚 API Reference
270
-
271
- ### Core Methods
272
-
273
- | Method | Description | Parameters |
274
- |--------|-------------|------------|
275
- | `createCanvas()` | Create a new canvas with background | `CanvasConfig` |
276
- | `createImage()` | Add shapes/images to canvas | `ImageProperties` |
277
- | `createText()` | Add text to canvas | `TextProperties` |
278
- | `createChart()` | Generate charts | `ChartConfig` |
279
- | `createGIF()` | Create animated GIFs | `GIFConfig` |
280
-
281
- ### Shape Types
282
-
283
- - `rectangle` - Standard rectangle
284
- - `square` - Perfect square
285
- - `circle` - Perfect circle
286
- - `triangle` - Equilateral triangle
287
- - `trapezium` - Trapezoid shape
288
- - `star` - 5-pointed star
289
- - `heart` - Heart shape with bezier curves
290
- - `polygon` - Custom polygon
291
-
292
- ### Pattern Types
293
-
294
- - `grid` - Grid pattern
295
- - `dots` - Dot pattern
296
- - `diagonal` - Diagonal lines
297
- - `stripes` - Horizontal/vertical stripes
298
- - `waves` - Wave pattern
299
- - `crosses` - Cross pattern
300
- - `hexagons` - Hexagonal pattern
301
- - `checkerboard` - Checkerboard pattern
302
- - `diamonds` - Diamond pattern
303
- - `triangles` - Triangle pattern
304
- - `stars` - Star pattern
305
- - `polka` - Polka dot pattern
306
- - `custom` - Custom image pattern
307
-
308
- ---
309
-
310
- ## 🤝 Contributing
311
-
312
- We welcome contributions! Here's how you can help:
313
-
314
- 1. **Report Bugs**: Found a bug? Open an issue with detailed information
315
- 2. **Feature Requests**: Have an idea? We'd love to hear it!
316
- 3. **Code Contributions**: Submit pull requests for improvements
317
- 4. **Documentation**: Help improve our docs and examples
318
-
319
- ### Development Setup
320
-
321
- ```bash
322
- # Clone the repository
323
- git clone https://github.com/your-username/apexify.git
324
-
325
- # Install dependencies
326
- npm install
327
-
328
- # Run tests
329
- npm test
330
-
331
- # Build the project
332
- npm run build
333
- ```
334
-
335
- ---
336
-
337
- ## 📞 Support & Community
338
-
339
- <div align="center">
340
-
341
- ### Join Our Discord Community
342
-
343
- [![Jedi Studio](https://img.shields.io/badge/Discord-Jedi%20Studio-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/CS2NRSPyze)
344
- [![FresedGPT](https://img.shields.io/badge/Discord-FresedGPT-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/94qUZWhwFE)
345
- [![ElectronHub](https://img.shields.io/badge/Discord-ElectronHub-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/83XcjD8vgW)
346
-
347
- ### Documentation & Resources
348
-
349
- [![Documentation](https://img.shields.io/badge/Docs-Apexify.js-blue?style=for-the-badge)](http://apexifyjs.jedi-studio.com)
350
- [![Support Server](https://img.shields.io/badge/Support-Discord-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/mDyXV9hzXw)
351
-
352
- </div>
353
-
354
- ---
355
-
356
- ## 📄 License
357
-
358
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
359
-
360
- ---
361
-
362
- ## 🙏 Acknowledgments
363
-
364
- - **@napi-rs/canvas** - High-performance canvas rendering
365
- - **Sharp** - Professional image processing
366
- - **Jimp** - JavaScript image manipulation
367
- - **TypeScript** - Type-safe development
368
-
369
- ---
370
-
371
- <div align="center">
372
-
373
- **Made with ❤️ by [Jedi Studio](https://discord.gg/CS2NRSPyze)**
374
-
375
- *Create stunning visuals with ApexPainter - The ultimate canvas library for Node.js*
376
-
377
- </div>
1
+ # 🎨 ApexPainter - Advanced Canvas Rendering Library
2
+
3
+ <div align="center">
4
+
5
+ ![ApexPainter Banner](./apex-banner.png)
6
+
7
+ **The Ultimate TypeScript Canvas Library for Node.js**
8
+
9
+ [![npm version](https://badge.fury.io/js/apexify.svg)](https://badge.fury.io/js/apexify)
10
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)
11
+ [![Node.js](https://img.shields.io/badge/Node.js-16%2B-green.svg)](https://nodejs.org/)
12
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
13
+
14
+ *Create stunning visuals with professional-grade canvas rendering, image processing, and text effects*
15
+
16
+ </div>
17
+
18
+ ## ✨ Features Overview
19
+
20
+ ### 🖼️ **Advanced Image Processing**
21
+ - **Professional Filters**: 22+ filters including blur, sharpen, vintage, cinematic effects
22
+ - **Shape Drawing**: 8+ shapes (rectangle, circle, heart, star, polygon, etc.)
23
+ - **Gradient Support**: Linear and radial gradients for fills and strokes
24
+ - **Shadow & Stroke Effects**: Customizable shadows and strokes for all shapes
25
+ - **Rotation & Positioning**: Full control over image placement and rotation
26
+
27
+ ### 🎨 **Rich Background System**
28
+ - **Multiple Background Types**: Solid colors, gradients, custom images
29
+ - **Pattern Overlays**: 12+ built-in patterns (grid, dots, stripes, hexagons, etc.)
30
+ - **Custom Patterns**: Use your own images as repeating patterns
31
+ - **Blend Modes**: 11+ blend modes for professional compositing
32
+ - **Noise Effects**: Add texture with customizable noise intensity
33
+
34
+ ### 📝 **Enhanced Text Rendering**
35
+ - **Font Management**: Custom fonts, sizes, families, and styles
36
+ - **Text Decorations**: Bold, italic, underline, overline, strikethrough, highlight
37
+ - **Advanced Effects**: Glow, shadow, stroke with gradient support
38
+ - **Spacing Control**: Letter spacing, word spacing, line height
39
+ - **Text Wrapping**: Automatic text wrapping with size constraints
40
+ - **Rotation**: Full 360° text rotation support
41
+
42
+ ### 🔧 **Professional Tools**
43
+ - **Chart Generation**: Bar charts, pie charts, line charts
44
+ - **GIF Creation**: Animated GIFs from image sequences
45
+ - **Format Conversion**: Convert between PNG, JPEG, WebP, and more
46
+ - **Image Manipulation**: Crop, resize, background removal
47
+ - **Color Detection**: Extract and analyze colors from images
48
+
49
+ ---
50
+
51
+ ## 🚀 Quick Start
52
+
53
+ ### Installation
54
+
55
+ ```bash
56
+ npm install apexify
57
+ ```
58
+
59
+ ### Basic Usage
60
+
61
+ ```typescript
62
+ import { ApexPainter } from 'apexify';
63
+
64
+ const painter = new ApexPainter();
65
+
66
+ // Create a canvas with gradient background
67
+ const canvas = await painter.createCanvas({
68
+ width: 800,
69
+ height: 600,
70
+ gradientBg: {
71
+ type: 'linear',
72
+ colors: [
73
+ { color: '#FF6B6B', position: 0 },
74
+ { color: '#4ECDC4', position: 0.5 },
75
+ { color: '#45B7D1', position: 1 }
76
+ ],
77
+ direction: { x1: 0, y1: 0, x2: 800, y2: 600 }
78
+ },
79
+ shadow: {
80
+ color: '#000',
81
+ offsetX: 10,
82
+ offsetY: 10,
83
+ blur: 20
84
+ },
85
+ borderRadius: 20
86
+ });
87
+
88
+ // Add a beautiful heart shape (single object)
89
+ const heartImage = await painter.createImage({
90
+ source: 'heart',
91
+ x: 300,
92
+ y: 200,
93
+ width: 200,
94
+ height: 200,
95
+ shape: {
96
+ fill: true,
97
+ gradient: {
98
+ type: 'radial',
99
+ colors: [
100
+ { color: '#FF6B6B', position: 0 },
101
+ { color: '#FF1744', position: 1 }
102
+ ],
103
+ center: { x: 100, y: 100 },
104
+ radius: 100
105
+ }
106
+ },
107
+ shadow: {
108
+ color: '#000',
109
+ offsetX: 15,
110
+ offsetY: 15,
111
+ blur: 25
112
+ },
113
+ stroke: {
114
+ color: '#FFF',
115
+ width: 5
116
+ }
117
+ }, canvas.buffer);
118
+
119
+ // Add stunning text (single object)
120
+ const textImage = await painter.createText({
121
+ text: 'ApexPainter',
122
+ x: 400,
123
+ y: 450,
124
+ fontSize: 48,
125
+ fontFamily: 'Arial',
126
+ bold: true,
127
+ gradient: {
128
+ type: 'linear',
129
+ colors: [
130
+ { color: '#FFD700', position: 0 },
131
+ { color: '#FF6B6B', position: 1 }
132
+ ],
133
+ direction: { x1: 0, y1: 0, x2: 300, y2: 0 }
134
+ },
135
+ glow: {
136
+ color: '#FFD700',
137
+ intensity: 0.8,
138
+ opacity: 0.9
139
+ },
140
+ shadow: {
141
+ color: '#000',
142
+ offsetX: 8,
143
+ offsetY: 8,
144
+ blur: 15
145
+ },
146
+ stroke: {
147
+ color: '#FFF',
148
+ width: 3
149
+ }
150
+ }, heartImage);
151
+
152
+ // Save the result
153
+ fs.writeFileSync('beautiful-artwork.png', textImage);
154
+ ```
155
+
156
+ ### 📝 **Flexible Array Support**
157
+
158
+ Both `createImage()` and `createText()` methods accept **single objects** OR **arrays of objects**:
159
+
160
+ ```typescript
161
+ // Single Object
162
+ await painter.createImage({
163
+ source: 'heart',
164
+ x: 100, y: 100,
165
+ width: 200, height: 200,
166
+ shape: { fill: true, color: '#ff6b6b' }
167
+ }, canvasBuffer);
168
+
169
+ // Array of Objects
170
+ await painter.createImage([
171
+ {
172
+ source: 'rectangle',
173
+ x: 50, y: 50,
174
+ width: 100, height: 80,
175
+ shape: { fill: true, color: '#ff6b6b' }
176
+ },
177
+ {
178
+ source: 'circle',
179
+ x: 200, y: 50,
180
+ width: 80, height: 80,
181
+ shape: { fill: true, color: '#4ecdc4' }
182
+ },
183
+ {
184
+ source: 'star',
185
+ x: 350, y: 50,
186
+ width: 80, height: 80,
187
+ shape: { fill: true, color: '#45b7d1' }
188
+ }
189
+ ], canvasBuffer);
190
+
191
+ // Single Text Object
192
+ await painter.createText({
193
+ text: 'Hello World',
194
+ x: 100, y: 100,
195
+ fontSize: 24,
196
+ color: '#ff6b6b'
197
+ }, canvasBuffer);
198
+
199
+ // ✅ Array of Text Objects
200
+ await painter.createText([
201
+ {
202
+ text: 'Title',
203
+ x: 100, y: 50,
204
+ fontSize: 32,
205
+ bold: true,
206
+ color: '#2c3e50'
207
+ },
208
+ {
209
+ text: 'Subtitle',
210
+ x: 100, y: 100,
211
+ fontSize: 18,
212
+ color: '#666'
213
+ },
214
+ {
215
+ text: 'Body text with effects',
216
+ x: 100, y: 150,
217
+ fontSize: 14,
218
+ color: '#333',
219
+ glow: { color: '#ffd700', intensity: 0.5 },
220
+ shadow: { color: '#000', offsetX: 2, offsetY: 2, blur: 4 }
221
+ }
222
+ ], canvasBuffer);
223
+ ```
224
+
225
+ ### 🎨 **Advanced Stroke Styles**
226
+
227
+ All stroke properties now support **6 different stroke styles**:
228
+
229
+ ```typescript
230
+ // ✅ Basic Stroke Styles
231
+ await painter.createImage({
232
+ source: 'rectangle',
233
+ x: 100, y: 100,
234
+ width: 200, height: 150,
235
+ shape: { fill: true, color: '#ffffff' },
236
+ stroke: {
237
+ color: '#ff6b6b',
238
+ width: 8,
239
+ style: 'dashed' // solid, dashed, dotted, groove, ridge, double
240
+ }
241
+ }, canvasBuffer);
242
+
243
+ // Gradient Strokes with Styles
244
+ await painter.createImage({
245
+ source: 'circle',
246
+ x: 200, y: 200,
247
+ width: 150, height: 150,
248
+ shape: { fill: true, color: '#ffffff' },
249
+ stroke: {
250
+ gradient: {
251
+ type: 'linear',
252
+ colors: [
253
+ { stop: 0, color: '#ff6b6b' },
254
+ { stop: 1, color: '#4ecdc4' }
255
+ ]
256
+ },
257
+ width: 6,
258
+ style: 'ridge' // Works with all styles!
259
+ }
260
+ }, canvasBuffer);
261
+
262
+ // ✅ Text Strokes with Styles
263
+ await painter.createText({
264
+ text: 'Styled Text',
265
+ x: 100, y: 100,
266
+ fontSize: 32,
267
+ color: '#ffffff',
268
+ stroke: {
269
+ color: '#ff6b6b',
270
+ width: 4,
271
+ style: 'double' // All 6 styles supported!
272
+ }
273
+ }, canvasBuffer);
274
+ ```
275
+
276
+ **Available Stroke Styles:**
277
+ - `solid` - Clean solid line (default)
278
+ - `dashed` - Dashed line pattern
279
+ - `dotted` - Dotted line pattern
280
+ - `groove` - 3D grooved effect (dark outer, light inner)
281
+ - `ridge` - 3D ridged effect (light outer, dark inner)
282
+ - `double` - Double parallel lines
283
+
284
+ ### 🔤 **Organized Font Management**
285
+
286
+ Text fonts are now organized in a clean `font` object structure:
287
+
288
+ ```typescript
289
+ // New Font Object Structure
290
+ await painter.createText({
291
+ text: 'Organized Font',
292
+ x: 100, y: 100,
293
+ font: {
294
+ size: 24, // Font size in pixels
295
+ family: 'Arial', // Font family name
296
+ name: 'customFont', // Custom font name (for registration)
297
+ path: './fonts/custom.ttf' // Path to custom font file
298
+ },
299
+ color: '#333333',
300
+ bold: true,
301
+ italic: true
302
+ }, canvasBuffer);
303
+
304
+ // Backward Compatibility (Legacy Properties)
305
+ await painter.createText({
306
+ text: 'Legacy Font Properties',
307
+ x: 100, y: 150,
308
+ fontSize: 24, // Still works!
309
+ fontFamily: 'Arial', // Still works!
310
+ fontName: 'customFont', // Still works!
311
+ fontPath: './fonts/custom.ttf', // Still works!
312
+ color: '#333333'
313
+ }, canvasBuffer);
314
+
315
+ // Mixed Usage (New Object Takes Priority)
316
+ await painter.createText({
317
+ text: 'Mixed Usage',
318
+ x: 100, y: 200,
319
+ font: {
320
+ size: 28,
321
+ family: 'Georgia'
322
+ },
323
+ fontSize: 24, // Ignored (font.size takes priority)
324
+ fontFamily: 'Arial', // Ignored (font.family takes priority)
325
+ color: '#333333'
326
+ }, canvasBuffer);
327
+ ```
328
+
329
+ **Font Object Properties:**
330
+ - `size` - Font size in pixels (replaces `fontSize`)
331
+ - `family` - Font family name (replaces `fontFamily`)
332
+ - `name` - Custom font name for registration (replaces `fontName`)
333
+ - `path` - Path to custom font file (replaces `fontPath`)
334
+
335
+ **Benefits:**
336
+ - **Cleaner Structure**: All font properties in one organized object
337
+ - **Better IntelliSense**: IDE autocomplete for font properties
338
+ - **Backward Compatible**: Legacy properties still work
339
+ - **Priority System**: New `font` object overrides legacy properties
340
+
341
+ ### 🌈 **Advanced Text Gradient Features**
342
+
343
+ Text effects now support **gradients** for enhanced visual appeal:
344
+
345
+ ```typescript
346
+ // ✅ Gradient Glow
347
+ await painter.createText({
348
+ text: 'Gradient Glow Text',
349
+ x: 100, y: 100,
350
+ fontSize: 32,
351
+ color: '#ffffff',
352
+ glow: {
353
+ gradient: {
354
+ type: 'linear',
355
+ colors: [
356
+ { stop: 0, color: '#ff6b6b' },
357
+ { stop: 1, color: '#4ecdc4' }
358
+ ]
359
+ },
360
+ intensity: 15,
361
+ opacity: 0.9
362
+ }
363
+ }, canvasBuffer);
364
+
365
+ // Gradient Highlight
366
+ await painter.createText({
367
+ text: 'Gradient Highlight',
368
+ x: 100, y: 150,
369
+ fontSize: 24,
370
+ color: '#000000',
371
+ highlight: {
372
+ gradient: {
373
+ type: 'radial',
374
+ colors: [
375
+ { stop: 0, color: '#ffd700' },
376
+ { stop: 1, color: '#ff6b6b' }
377
+ ]
378
+ },
379
+ opacity: 0.6
380
+ }
381
+ }, canvasBuffer);
382
+
383
+ // ✅ Gradient Text Decorations
384
+ await painter.createText({
385
+ text: 'Styled Decorations',
386
+ x: 100, y: 200,
387
+ fontSize: 28,
388
+ color: '#ffffff',
389
+ underline: {
390
+ gradient: {
391
+ type: 'linear',
392
+ colors: [
393
+ { stop: 0, color: '#ff6b6b' },
394
+ { stop: 1, color: '#4ecdc4' }
395
+ ]
396
+ },
397
+ width: 4
398
+ },
399
+ overline: {
400
+ gradient: {
401
+ type: 'linear',
402
+ colors: [
403
+ { stop: 0, color: '#feca57' },
404
+ { stop: 1, color: '#ff9ff3' }
405
+ ]
406
+ },
407
+ width: 3
408
+ },
409
+ strikethrough: {
410
+ gradient: {
411
+ type: 'linear',
412
+ colors: [
413
+ { stop: 0, color: '#96ceb4' },
414
+ { stop: 1, color: '#45b7d1' }
415
+ ]
416
+ },
417
+ width: 5
418
+ }
419
+ }, canvasBuffer);
420
+
421
+ // ✅ Backward Compatibility (Simple Boolean)
422
+ await painter.createText({
423
+ text: 'Simple Decorations',
424
+ x: 100, y: 250,
425
+ fontSize: 24,
426
+ color: '#ffffff',
427
+ underline: true, // Uses default color
428
+ overline: true, // Uses default color
429
+ strikethrough: true // Uses default color
430
+ }, canvasBuffer);
431
+ ```
432
+
433
+ **Gradient Support:**
434
+ - **Glow**: Gradient glow effects with intensity and opacity
435
+ - **Highlight**: Gradient background highlights
436
+ - **Underline**: Custom gradient underlines with width control
437
+ - **Overline**: Custom gradient overlines with width control
438
+ - **Strikethrough**: Custom gradient strikethrough with width control
439
+ - **Backward Compatible**: Simple `boolean` values still work
440
+
441
+ ---
442
+
443
+ ## 🎯 Real-World Examples
444
+
445
+ ### 🏢 **Business Cards & Marketing Materials**
446
+
447
+ ```typescript
448
+ // Create a professional business card
449
+ const businessCard = await painter.createCanvas({
450
+ width: 400,
451
+ height: 250,
452
+ gradientBg: {
453
+ type: 'linear',
454
+ colors: [
455
+ { color: '#2C3E50', position: 0 },
456
+ { color: '#34495E', position: 1 }
457
+ ],
458
+ direction: { x1: 0, y1: 0, x2: 400, y2: 250 }
459
+ },
460
+ patternBg: {
461
+ type: 'dots',
462
+ color: '#FFF',
463
+ opacity: 0.1,
464
+ size: 5,
465
+ spacing: 20
466
+ }
467
+ });
468
+
469
+ // Add company logo (star shape)
470
+ const logo = await painter.createImage({
471
+ source: 'star',
472
+ x: 50,
473
+ y: 50,
474
+ width: 60,
475
+ height: 60,
476
+ fill: true,
477
+ color: '#FFD700',
478
+ shadow: { color: '#000', offsetX: 3, offsetY: 3, blur: 8 }
479
+ }, businessCard.buffer);
480
+
481
+ // Add company name
482
+ const companyText = await painter.createText({
483
+ text: 'ACME Corp',
484
+ x: 130,
485
+ y: 80,
486
+ fontSize: 24,
487
+ fontFamily: 'Arial',
488
+ bold: true,
489
+ color: '#FFF',
490
+ shadow: { color: '#000', offsetX: 2, offsetY: 2, blur: 4 }
491
+ }, logo);
492
+
493
+ // Add contact info
494
+ const contactText = await painter.createText({
495
+ text: 'john@acme.com\n+1 (555) 123-4567',
496
+ x: 50,
497
+ y: 150,
498
+ fontSize: 14,
499
+ fontFamily: 'Arial',
500
+ color: '#BDC3C7',
501
+ lineHeight: 1.5
502
+ }, companyText);
503
+ ```
504
+
505
+ ### 🎮 **Game UI Elements**
506
+
507
+ ```typescript
508
+ // Create a game button
509
+ const gameButton = await painter.createCanvas({
510
+ width: 200,
511
+ height: 60,
512
+ gradientBg: {
513
+ type: 'linear',
514
+ colors: [
515
+ { color: '#FF6B6B', position: 0 },
516
+ { color: '#FF1744', position: 1 }
517
+ ],
518
+ direction: { x1: 0, y1: 0, x2: 200, y2: 60 }
519
+ },
520
+ shadow: {
521
+ color: '#000',
522
+ offsetX: 5,
523
+ offsetY: 5,
524
+ blur: 15
525
+ },
526
+ borderRadius: 30
527
+ });
528
+
529
+ // Add button text with glow effect
530
+ const buttonText = await painter.createText({
531
+ text: 'PLAY NOW',
532
+ x: 100,
533
+ y: 35,
534
+ fontSize: 20,
535
+ fontFamily: 'Arial',
536
+ bold: true,
537
+ color: '#FFF',
538
+ textAlign: 'center',
539
+ textBaseline: 'middle',
540
+ glow: {
541
+ color: '#FFD700',
542
+ intensity: 0.6,
543
+ opacity: 0.8
544
+ },
545
+ shadow: {
546
+ color: '#000',
547
+ offsetX: 2,
548
+ offsetY: 2,
549
+ blur: 4
550
+ }
551
+ }, gameButton.buffer);
552
+ ```
553
+
554
+ ---
555
+
556
+ ## 📚 API Reference
557
+
558
+ ### Core Methods
559
+
560
+ | Method | Description | Parameters |
561
+ |--------|-------------|------------|
562
+ | `createCanvas()` | Create a new canvas with background | `CanvasConfig` |
563
+ | `createImage()` | Add shapes/images to canvas | `ImageProperties \| ImageProperties[]` |
564
+ | `createText()` | Add text to canvas | `TextProperties \| TextProperties[]` |
565
+ | `createChart()` | Generate charts | `ChartConfig` |
566
+ | `createGIF()` | Create animated GIFs | `GIFConfig` |
567
+
568
+ ### 🔄 **Flexible Parameters**
569
+
570
+ Both `createImage()` and `createText()` methods accept:
571
+ - **Single Object**: `ImageProperties` or `TextProperties`
572
+ - **Array of Objects**: `ImageProperties[]` or `TextProperties[]`
573
+
574
+ This allows you to add multiple elements in one call for better performance and cleaner code.
575
+
576
+ ### Shape Types
577
+
578
+ - `rectangle` - Standard rectangle
579
+ - `square` - Perfect square
580
+ - `circle` - Perfect circle
581
+ - `triangle` - Equilateral triangle
582
+ - `trapezium` - Trapezoid shape
583
+ - `star` - 5-pointed star
584
+ - `heart` - Heart shape with bezier curves
585
+ - `polygon` - Custom polygon
586
+
587
+ ### Pattern Types
588
+
589
+ - `grid` - Grid pattern
590
+ - `dots` - Dot pattern
591
+ - `diagonal` - Diagonal lines
592
+ - `stripes` - Horizontal/vertical stripes
593
+ - `waves` - Wave pattern
594
+ - `crosses` - Cross pattern
595
+ - `hexagons` - Hexagonal pattern
596
+ - `checkerboard` - Checkerboard pattern
597
+ - `diamonds` - Diamond pattern
598
+ - `triangles` - Triangle pattern
599
+ - `stars` - Star pattern
600
+ - `polka` - Polka dot pattern
601
+ - `custom` - Custom image pattern
602
+
603
+ ---
604
+
605
+ ## 🤝 Contributing
606
+
607
+ We welcome contributions! Here's how you can help:
608
+
609
+ 1. **Report Bugs**: Found a bug? Open an issue with detailed information
610
+ 2. **Feature Requests**: Have an idea? We'd love to hear it!
611
+ 3. **Code Contributions**: Submit pull requests for improvements
612
+ 4. **Documentation**: Help improve our docs and examples
613
+
614
+ ### Development Setup
615
+
616
+ ```bash
617
+ # Clone the repository
618
+ git clone https://github.com/your-username/apexify.git
619
+
620
+ # Install dependencies
621
+ npm install
622
+
623
+ # Run tests
624
+ npm test
625
+
626
+ # Build the project
627
+ npm run build
628
+ ```
629
+
630
+ ---
631
+
632
+ ## 📞 Support & Community
633
+
634
+ <div align="center">
635
+
636
+ ### Join Our Discord Community
637
+
638
+ [![Jedi Studio](https://img.shields.io/badge/Discord-Jedi%20Studio-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/CS2NRSPyze)
639
+ [![FresedGPT](https://img.shields.io/badge/Discord-FresedGPT-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/94qUZWhwFE)
640
+ [![ElectronHub](https://img.shields.io/badge/Discord-ElectronHub-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/83XcjD8vgW)
641
+
642
+ ### Documentation & Resources
643
+
644
+ [![Documentation](https://img.shields.io/badge/Docs-Apexify.js-blue?style=for-the-badge)](http://apexifyjs.jedi-studio.com)
645
+ [![Support Server](https://img.shields.io/badge/Support-Discord-7289DA?style=for-the-badge&logo=discord)](https://discord.gg/mDyXV9hzXw)
646
+
647
+ </div>
648
+
649
+ ---
650
+
651
+ ## 📄 License
652
+
653
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
654
+
655
+ ---
656
+
657
+ ## 🙏 Acknowledgments
658
+
659
+ - **@napi-rs/canvas** - High-performance canvas rendering
660
+ - **Sharp** - Professional image processing
661
+ - **Jimp** - JavaScript image manipulation
662
+ - **TypeScript** - Type-safe development
663
+
664
+ ---
665
+
666
+ <div align="center">
667
+
668
+ **Made with ❤️ by [Jedi Studio](https://discord.gg/CS2NRSPyze)**
669
+
670
+ *Create stunning visuals with ApexPainter - The ultimate canvas library for Node.js*
671
+
672
+ </div>