apexify.js 4.9.28 → 5.0.0
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 +727 -456
- package/dist/cjs/Canvas/ApexPainter.d.ts +96 -145
- package/dist/cjs/Canvas/ApexPainter.d.ts.map +1 -1
- package/dist/cjs/Canvas/ApexPainter.js +1416 -420
- package/dist/cjs/Canvas/ApexPainter.js.map +1 -1
- package/dist/cjs/Canvas/utils/Charts/charts.d.ts +7 -2
- package/dist/cjs/Canvas/utils/Charts/charts.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/Charts/charts.js +3 -1
- package/dist/cjs/Canvas/utils/Charts/charts.js.map +1 -1
- package/dist/cjs/Canvas/utils/Custom/advancedLines.d.ts +75 -0
- package/dist/cjs/Canvas/utils/Custom/advancedLines.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Custom/advancedLines.js +263 -0
- package/dist/cjs/Canvas/utils/Custom/advancedLines.js.map +1 -0
- package/dist/cjs/Canvas/utils/Custom/customLines.d.ts +2 -1
- package/dist/cjs/Canvas/utils/Custom/customLines.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/Custom/customLines.js +73 -6
- package/dist/cjs/Canvas/utils/Custom/customLines.js.map +1 -1
- package/dist/cjs/Canvas/utils/General/batchOperations.d.ts +17 -0
- package/dist/cjs/Canvas/utils/General/batchOperations.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/General/batchOperations.js +88 -0
- package/dist/cjs/Canvas/utils/General/batchOperations.js.map +1 -0
- package/dist/cjs/Canvas/utils/General/general functions.d.ts +25 -3
- package/dist/cjs/Canvas/utils/General/general functions.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/General/general functions.js +37 -9
- package/dist/cjs/Canvas/utils/General/general functions.js.map +1 -1
- package/dist/cjs/Canvas/utils/General/imageCompression.d.ts +19 -0
- package/dist/cjs/Canvas/utils/General/imageCompression.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/General/imageCompression.js +262 -0
- package/dist/cjs/Canvas/utils/General/imageCompression.js.map +1 -0
- package/dist/cjs/Canvas/utils/General/imageStitching.d.ts +20 -0
- package/dist/cjs/Canvas/utils/General/imageStitching.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/General/imageStitching.js +227 -0
- package/dist/cjs/Canvas/utils/General/imageStitching.js.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageEffects.d.ts +37 -0
- package/dist/cjs/Canvas/utils/Image/imageEffects.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageEffects.js +128 -0
- package/dist/cjs/Canvas/utils/Image/imageEffects.js.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageMasking.d.ts +67 -0
- package/dist/cjs/Canvas/utils/Image/imageMasking.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageMasking.js +276 -0
- package/dist/cjs/Canvas/utils/Image/imageMasking.js.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageProperties.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/Image/imageProperties.js +181 -2
- package/dist/cjs/Canvas/utils/Image/imageProperties.js.map +1 -1
- package/dist/cjs/Canvas/utils/Patterns/enhancedPatternRenderer.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/Patterns/enhancedPatternRenderer.js +16 -8
- package/dist/cjs/Canvas/utils/Patterns/enhancedPatternRenderer.js.map +1 -1
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts +33 -0
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js +237 -32
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -1
- package/dist/cjs/Canvas/utils/Texts/textPathRenderer.d.ts +17 -0
- package/dist/cjs/Canvas/utils/Texts/textPathRenderer.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Texts/textPathRenderer.js +233 -0
- package/dist/cjs/Canvas/utils/Texts/textPathRenderer.js.map +1 -0
- package/dist/cjs/Canvas/utils/types.d.ts +171 -10
- package/dist/cjs/Canvas/utils/types.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/types.js.map +1 -1
- package/dist/cjs/Canvas/utils/utils.d.ts +9 -2
- package/dist/cjs/Canvas/utils/utils.d.ts.map +1 -1
- package/dist/cjs/Canvas/utils/utils.js +32 -1
- package/dist/cjs/Canvas/utils/utils.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/Canvas/ApexPainter.d.ts +96 -145
- package/dist/esm/Canvas/ApexPainter.d.ts.map +1 -1
- package/dist/esm/Canvas/ApexPainter.js +1416 -420
- package/dist/esm/Canvas/ApexPainter.js.map +1 -1
- package/dist/esm/Canvas/utils/Charts/charts.d.ts +7 -2
- package/dist/esm/Canvas/utils/Charts/charts.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/Charts/charts.js +3 -1
- package/dist/esm/Canvas/utils/Charts/charts.js.map +1 -1
- package/dist/esm/Canvas/utils/Custom/advancedLines.d.ts +75 -0
- package/dist/esm/Canvas/utils/Custom/advancedLines.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Custom/advancedLines.js +263 -0
- package/dist/esm/Canvas/utils/Custom/advancedLines.js.map +1 -0
- package/dist/esm/Canvas/utils/Custom/customLines.d.ts +2 -1
- package/dist/esm/Canvas/utils/Custom/customLines.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/Custom/customLines.js +73 -6
- package/dist/esm/Canvas/utils/Custom/customLines.js.map +1 -1
- package/dist/esm/Canvas/utils/General/batchOperations.d.ts +17 -0
- package/dist/esm/Canvas/utils/General/batchOperations.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/General/batchOperations.js +88 -0
- package/dist/esm/Canvas/utils/General/batchOperations.js.map +1 -0
- package/dist/esm/Canvas/utils/General/general functions.d.ts +25 -3
- package/dist/esm/Canvas/utils/General/general functions.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/General/general functions.js +37 -9
- package/dist/esm/Canvas/utils/General/general functions.js.map +1 -1
- package/dist/esm/Canvas/utils/General/imageCompression.d.ts +19 -0
- package/dist/esm/Canvas/utils/General/imageCompression.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/General/imageCompression.js +262 -0
- package/dist/esm/Canvas/utils/General/imageCompression.js.map +1 -0
- package/dist/esm/Canvas/utils/General/imageStitching.d.ts +20 -0
- package/dist/esm/Canvas/utils/General/imageStitching.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/General/imageStitching.js +227 -0
- package/dist/esm/Canvas/utils/General/imageStitching.js.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageEffects.d.ts +37 -0
- package/dist/esm/Canvas/utils/Image/imageEffects.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageEffects.js +128 -0
- package/dist/esm/Canvas/utils/Image/imageEffects.js.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageMasking.d.ts +67 -0
- package/dist/esm/Canvas/utils/Image/imageMasking.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageMasking.js +276 -0
- package/dist/esm/Canvas/utils/Image/imageMasking.js.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageProperties.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/Image/imageProperties.js +181 -2
- package/dist/esm/Canvas/utils/Image/imageProperties.js.map +1 -1
- package/dist/esm/Canvas/utils/Patterns/enhancedPatternRenderer.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/Patterns/enhancedPatternRenderer.js +16 -8
- package/dist/esm/Canvas/utils/Patterns/enhancedPatternRenderer.js.map +1 -1
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts +33 -0
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js +237 -32
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -1
- package/dist/esm/Canvas/utils/Texts/textPathRenderer.d.ts +17 -0
- package/dist/esm/Canvas/utils/Texts/textPathRenderer.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Texts/textPathRenderer.js +233 -0
- package/dist/esm/Canvas/utils/Texts/textPathRenderer.js.map +1 -0
- package/dist/esm/Canvas/utils/types.d.ts +171 -10
- package/dist/esm/Canvas/utils/types.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/types.js.map +1 -1
- package/dist/esm/Canvas/utils/utils.d.ts +9 -2
- package/dist/esm/Canvas/utils/utils.d.ts.map +1 -1
- package/dist/esm/Canvas/utils/utils.js +32 -1
- package/dist/esm/Canvas/utils/utils.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/Canvas/ApexPainter.ts +1309 -267
- package/lib/Canvas/utils/Charts/charts.ts +16 -7
- package/lib/Canvas/utils/Custom/advancedLines.ts +335 -0
- package/lib/Canvas/utils/Custom/customLines.ts +84 -9
- package/lib/Canvas/utils/General/batchOperations.ts +103 -0
- package/lib/Canvas/utils/General/general functions.ts +85 -41
- package/lib/Canvas/utils/General/imageCompression.ts +316 -0
- package/lib/Canvas/utils/General/imageStitching.ts +252 -0
- package/lib/Canvas/utils/Image/imageEffects.ts +175 -0
- package/lib/Canvas/utils/Image/imageMasking.ts +335 -0
- package/lib/Canvas/utils/Image/imageProperties.ts +207 -2
- package/lib/Canvas/utils/Patterns/enhancedPatternRenderer.ts +455 -444
- package/lib/Canvas/utils/Texts/enhancedTextRenderer.ts +274 -36
- package/lib/Canvas/utils/Texts/textPathRenderer.ts +320 -0
- package/lib/Canvas/utils/types.ts +173 -10
- package/lib/Canvas/utils/utils.ts +49 -2
- package/package.json +69 -34
package/README.md
CHANGED
|
@@ -1,456 +1,727 @@
|
|
|
1
|
-
# 🎨 ApexPainter - Advanced Canvas Rendering Library
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
**The Ultimate TypeScript Canvas Library for Node.js**
|
|
8
|
-
|
|
9
|
-
[](https://badge.fury.io/js/apexify)
|
|
10
|
-
[](https://www.typescriptlang.org/)
|
|
11
|
-
[](https://nodejs.org/)
|
|
12
|
-
[](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
|
-
- **
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
color: '#
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
//
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
//
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
- **
|
|
356
|
-
- **
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
###
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
#
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
1
|
+
# 🎨 ApexPainter - Advanced Canvas Rendering Library
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+

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