apexify.js 4.9.25 → 4.9.27
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 +358 -47
- package/dist/cjs/Canvas/ApexPainter.d.ts +189 -0
- package/dist/cjs/Canvas/ApexPainter.d.ts.map +1 -0
- package/dist/{esm/canvas → cjs/Canvas}/ApexPainter.js +461 -352
- package/dist/cjs/Canvas/ApexPainter.js.map +1 -0
- package/dist/cjs/Canvas/utils/Background/bg.d.ts +43 -0
- package/dist/cjs/Canvas/utils/Background/bg.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Background/bg.js +228 -0
- package/dist/cjs/Canvas/utils/Background/bg.js.map +1 -0
- package/dist/cjs/{canvas → Canvas}/utils/Charts/charts.d.ts.map +1 -1
- package/dist/{esm/canvas → cjs/Canvas}/utils/Charts/charts.js.map +1 -1
- package/dist/cjs/{canvas → Canvas}/utils/Custom/customLines.d.ts.map +1 -1
- package/dist/{esm/canvas → cjs/Canvas}/utils/Custom/customLines.js +2 -2
- package/dist/cjs/Canvas/utils/Custom/customLines.js.map +1 -0
- package/dist/cjs/{canvas → Canvas}/utils/General/conversion.d.ts.map +1 -1
- package/dist/cjs/{canvas → Canvas}/utils/General/conversion.js.map +1 -1
- package/dist/cjs/{canvas → Canvas}/utils/General/general functions.d.ts.map +1 -1
- package/dist/{esm/canvas → cjs/Canvas}/utils/General/general functions.js.map +1 -1
- package/dist/cjs/Canvas/utils/Image/imageFilters.d.ts +11 -0
- package/dist/cjs/Canvas/utils/Image/imageFilters.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageFilters.js +307 -0
- package/dist/cjs/Canvas/utils/Image/imageFilters.js.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageProperties.d.ts +50 -0
- package/dist/cjs/Canvas/utils/Image/imageProperties.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Image/imageProperties.js +271 -0
- package/dist/cjs/Canvas/utils/Image/imageProperties.js.map +1 -0
- package/dist/cjs/Canvas/utils/Image/professionalImageFilters.d.ts +11 -0
- package/dist/cjs/Canvas/utils/Image/professionalImageFilters.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Image/professionalImageFilters.js +351 -0
- package/dist/cjs/Canvas/utils/Image/professionalImageFilters.js.map +1 -0
- package/dist/cjs/Canvas/utils/Image/simpleProfessionalFilters.d.ts +11 -0
- package/dist/cjs/Canvas/utils/Image/simpleProfessionalFilters.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Image/simpleProfessionalFilters.js +215 -0
- package/dist/cjs/Canvas/utils/Image/simpleProfessionalFilters.js.map +1 -0
- package/dist/cjs/Canvas/utils/Patterns/enhancedPatternRenderer.d.ts +71 -0
- package/dist/cjs/Canvas/utils/Patterns/enhancedPatternRenderer.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Patterns/enhancedPatternRenderer.js +392 -0
- package/dist/cjs/Canvas/utils/Patterns/enhancedPatternRenderer.js.map +1 -0
- package/dist/cjs/Canvas/utils/Shapes/shapes.d.ts +29 -0
- package/dist/cjs/Canvas/utils/Shapes/shapes.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Shapes/shapes.js +334 -0
- package/dist/cjs/Canvas/utils/Shapes/shapes.js.map +1 -0
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts +127 -0
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -0
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js +365 -0
- package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -0
- package/dist/cjs/{canvas → Canvas}/utils/Texts/textProperties.d.ts.map +1 -1
- package/dist/{esm/canvas → cjs/Canvas}/utils/Texts/textProperties.js.map +1 -1
- package/dist/{esm/canvas → cjs/Canvas}/utils/types.d.ts +227 -131
- package/dist/cjs/Canvas/utils/types.d.ts.map +1 -0
- package/dist/cjs/{canvas → Canvas}/utils/types.js +0 -1
- package/dist/cjs/Canvas/utils/types.js.map +1 -0
- package/dist/cjs/Canvas/utils/utils.d.ts +22 -0
- package/dist/cjs/Canvas/utils/utils.d.ts.map +1 -0
- package/dist/{esm/canvas → cjs/Canvas}/utils/utils.js +17 -7
- package/dist/cjs/Canvas/utils/utils.js.map +1 -0
- package/dist/cjs/index.d.ts +6 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils.d.ts +1 -1
- package/dist/cjs/utils.js +1 -1
- package/dist/esm/Canvas/ApexPainter.d.ts +189 -0
- package/dist/esm/Canvas/ApexPainter.d.ts.map +1 -0
- package/dist/{cjs/canvas → esm/Canvas}/ApexPainter.js +461 -352
- package/dist/esm/Canvas/ApexPainter.js.map +1 -0
- package/dist/esm/Canvas/utils/Background/bg.d.ts +43 -0
- package/dist/esm/Canvas/utils/Background/bg.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Background/bg.js +228 -0
- package/dist/esm/Canvas/utils/Background/bg.js.map +1 -0
- package/dist/esm/{canvas → Canvas}/utils/Charts/charts.d.ts.map +1 -1
- package/dist/{cjs/canvas → esm/Canvas}/utils/Charts/charts.js.map +1 -1
- package/dist/esm/{canvas → Canvas}/utils/Custom/customLines.d.ts.map +1 -1
- package/dist/{cjs/canvas → esm/Canvas}/utils/Custom/customLines.js +2 -2
- package/dist/esm/Canvas/utils/Custom/customLines.js.map +1 -0
- package/dist/esm/{canvas → Canvas}/utils/General/conversion.d.ts.map +1 -1
- package/dist/esm/{canvas → Canvas}/utils/General/conversion.js.map +1 -1
- package/dist/esm/{canvas → Canvas}/utils/General/general functions.d.ts.map +1 -1
- package/dist/{cjs/canvas → esm/Canvas}/utils/General/general functions.js.map +1 -1
- package/dist/esm/Canvas/utils/Image/imageFilters.d.ts +11 -0
- package/dist/esm/Canvas/utils/Image/imageFilters.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageFilters.js +307 -0
- package/dist/esm/Canvas/utils/Image/imageFilters.js.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageProperties.d.ts +50 -0
- package/dist/esm/Canvas/utils/Image/imageProperties.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Image/imageProperties.js +271 -0
- package/dist/esm/Canvas/utils/Image/imageProperties.js.map +1 -0
- package/dist/esm/Canvas/utils/Image/professionalImageFilters.d.ts +11 -0
- package/dist/esm/Canvas/utils/Image/professionalImageFilters.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Image/professionalImageFilters.js +351 -0
- package/dist/esm/Canvas/utils/Image/professionalImageFilters.js.map +1 -0
- package/dist/esm/Canvas/utils/Image/simpleProfessionalFilters.d.ts +11 -0
- package/dist/esm/Canvas/utils/Image/simpleProfessionalFilters.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Image/simpleProfessionalFilters.js +215 -0
- package/dist/esm/Canvas/utils/Image/simpleProfessionalFilters.js.map +1 -0
- package/dist/esm/Canvas/utils/Patterns/enhancedPatternRenderer.d.ts +71 -0
- package/dist/esm/Canvas/utils/Patterns/enhancedPatternRenderer.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Patterns/enhancedPatternRenderer.js +392 -0
- package/dist/esm/Canvas/utils/Patterns/enhancedPatternRenderer.js.map +1 -0
- package/dist/esm/Canvas/utils/Shapes/shapes.d.ts +29 -0
- package/dist/esm/Canvas/utils/Shapes/shapes.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Shapes/shapes.js +334 -0
- package/dist/esm/Canvas/utils/Shapes/shapes.js.map +1 -0
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts +127 -0
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -0
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js +365 -0
- package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -0
- package/dist/esm/{canvas → Canvas}/utils/Texts/textProperties.d.ts.map +1 -1
- package/dist/{cjs/canvas → esm/Canvas}/utils/Texts/textProperties.js.map +1 -1
- package/dist/{cjs/canvas → esm/Canvas}/utils/types.d.ts +227 -131
- package/dist/esm/Canvas/utils/types.d.ts.map +1 -0
- package/dist/esm/{canvas → Canvas}/utils/types.js +0 -1
- package/dist/esm/Canvas/utils/types.js.map +1 -0
- package/dist/esm/Canvas/utils/utils.d.ts +22 -0
- package/dist/esm/Canvas/utils/utils.d.ts.map +1 -0
- package/dist/{cjs/canvas → esm/Canvas}/utils/utils.js +17 -7
- package/dist/esm/Canvas/utils/utils.js.map +1 -0
- package/dist/esm/index.d.ts +6 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/utils.d.ts +1 -1
- package/dist/esm/utils.js +1 -1
- package/lib/{canvas → Canvas}/ApexPainter.ts +1325 -1218
- package/lib/Canvas/utils/Background/bg.ts +285 -0
- package/lib/{canvas → Canvas}/utils/Custom/customLines.ts +3 -3
- package/lib/Canvas/utils/Image/imageFilters.ts +356 -0
- package/lib/Canvas/utils/Image/imageProperties.ts +382 -0
- package/lib/Canvas/utils/Image/professionalImageFilters.ts +391 -0
- package/lib/Canvas/utils/Image/simpleProfessionalFilters.ts +229 -0
- package/lib/Canvas/utils/Patterns/enhancedPatternRenderer.ts +444 -0
- package/lib/Canvas/utils/Shapes/shapes.ts +528 -0
- package/lib/Canvas/utils/Texts/enhancedTextRenderer.ts +478 -0
- package/lib/{canvas → Canvas}/utils/types.ts +301 -117
- package/lib/{canvas → Canvas}/utils/utils.ts +85 -72
- package/lib/index.ts +8 -9
- package/lib/utils.ts +1 -1
- package/package.json +107 -191
- package/dist/cjs/canvas/ApexPainter.d.ts +0 -145
- package/dist/cjs/canvas/ApexPainter.d.ts.map +0 -1
- package/dist/cjs/canvas/ApexPainter.js.map +0 -1
- package/dist/cjs/canvas/utils/Background/bg.d.ts +0 -31
- package/dist/cjs/canvas/utils/Background/bg.d.ts.map +0 -1
- package/dist/cjs/canvas/utils/Background/bg.js +0 -161
- package/dist/cjs/canvas/utils/Background/bg.js.map +0 -1
- package/dist/cjs/canvas/utils/Custom/customLines.js.map +0 -1
- package/dist/cjs/canvas/utils/Image/imageProperties.d.ts +0 -115
- package/dist/cjs/canvas/utils/Image/imageProperties.d.ts.map +0 -1
- package/dist/cjs/canvas/utils/Image/imageProperties.js +0 -602
- package/dist/cjs/canvas/utils/Image/imageProperties.js.map +0 -1
- package/dist/cjs/canvas/utils/types.d.ts.map +0 -1
- package/dist/cjs/canvas/utils/types.js.map +0 -1
- package/dist/cjs/canvas/utils/utils.d.ts +0 -19
- package/dist/cjs/canvas/utils/utils.d.ts.map +0 -1
- package/dist/cjs/canvas/utils/utils.js.map +0 -1
- package/dist/esm/canvas/ApexPainter.d.ts +0 -145
- package/dist/esm/canvas/ApexPainter.d.ts.map +0 -1
- package/dist/esm/canvas/ApexPainter.js.map +0 -1
- package/dist/esm/canvas/utils/Background/bg.d.ts +0 -31
- package/dist/esm/canvas/utils/Background/bg.d.ts.map +0 -1
- package/dist/esm/canvas/utils/Background/bg.js +0 -161
- package/dist/esm/canvas/utils/Background/bg.js.map +0 -1
- package/dist/esm/canvas/utils/Custom/customLines.js.map +0 -1
- package/dist/esm/canvas/utils/Image/imageProperties.d.ts +0 -115
- package/dist/esm/canvas/utils/Image/imageProperties.d.ts.map +0 -1
- package/dist/esm/canvas/utils/Image/imageProperties.js +0 -602
- package/dist/esm/canvas/utils/Image/imageProperties.js.map +0 -1
- package/dist/esm/canvas/utils/types.d.ts.map +0 -1
- package/dist/esm/canvas/utils/types.js.map +0 -1
- package/dist/esm/canvas/utils/utils.d.ts +0 -19
- package/dist/esm/canvas/utils/utils.d.ts.map +0 -1
- package/dist/esm/canvas/utils/utils.js.map +0 -1
- package/lib/canvas/utils/Background/bg.ts +0 -211
- package/lib/canvas/utils/Image/imageProperties.ts +0 -835
- /package/dist/cjs/{canvas → Canvas}/utils/Charts/charts.d.ts +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/Charts/charts.js +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/Custom/customLines.d.ts +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/General/conversion.d.ts +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/General/conversion.js +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/General/general functions.d.ts +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/General/general functions.js +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/Texts/textProperties.d.ts +0 -0
- /package/dist/cjs/{canvas → Canvas}/utils/Texts/textProperties.js +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/Charts/charts.d.ts +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/Charts/charts.js +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/Custom/customLines.d.ts +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/General/conversion.d.ts +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/General/conversion.js +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/General/general functions.d.ts +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/General/general functions.js +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/Texts/textProperties.d.ts +0 -0
- /package/dist/esm/{canvas → Canvas}/utils/Texts/textProperties.js +0 -0
- /package/lib/{canvas → Canvas}/utils/Charts/charts.ts +0 -0
- /package/lib/{canvas → Canvas}/utils/General/conversion.ts +0 -0
- /package/lib/{canvas → Canvas}/utils/General/general functions.ts +0 -0
- /package/lib/{canvas → Canvas}/utils/Texts/textProperties.ts +0 -0
package/README.md
CHANGED
|
@@ -1,66 +1,377 @@
|
|
|
1
|
-
|
|
1
|
+
# 🎨 ApexPainter - Advanced Canvas Rendering Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**The Ultimate TypeScript Canvas Library for Node.js**
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
[](https://badge.fury.io/js/apexify)
|
|
10
|
+
[](https://www.typescriptlang.org/)
|
|
11
|
+
[](https://nodejs.org/)
|
|
12
|
+
[](LICENSE)
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
*Create stunning visuals with professional-grade canvas rendering, image processing, and text effects*
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
- **AI Chat Bot:** Experience advanced conversational capabilities with our state-of-the-art AI chatbot.
|
|
15
|
-
- **Image Generator:** Generate images using cutting-edge AI algorithms.
|
|
16
|
-
- **Image Analysis:** Analyze images with AI for insights and understanding.
|
|
17
|
-
- **PDF & Text Reader:** Effortlessly extract text from PDF files or other documents.
|
|
18
|
-
- **Text to Speech:** Convert text into natural-sounding speech with high-quality synthesis.
|
|
19
|
-
- **Speech to Text:** Transcribe spoken words into text with high accuracy.
|
|
20
|
-
- **Text Extractor:** Extract and process text from various sources and formats.
|
|
21
|
-
- **Custom Role Plays:** Create and engage in custom role-playing scenarios with tailored AI responses.
|
|
22
|
-
- **AI Personality:** Personalize your interactions with the AI chatbot by defining its personality traits and characteristics.
|
|
23
|
-
- **Chat Memory:** Enable the AI chatbot to remember past interactions and maintain context across conversations, providing a more personalized and coherent experience.
|
|
16
|
+
</div>
|
|
24
17
|
|
|
25
|
-
|
|
18
|
+
## ✨ Features Overview
|
|
26
19
|
|
|
27
|
-
**
|
|
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
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **Custom
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **Resizing and Format Conversion:** Resize images and convert between different file formats.
|
|
36
|
-
- **Charts Generation:** Create pie charts, bar charts, and line charts using provided data.
|
|
37
|
-
- **Background Removal:** Effortlessly remove backgrounds from images.
|
|
38
|
-
- **Color Detection:** Detect colors within images.
|
|
39
|
-
- **Color Removal:** Remove specific colors from images using RGB values.
|
|
40
|
-
- **Image Cropping:** Crop images with flexibility and customization options.
|
|
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
|
|
41
33
|
|
|
42
|
-
|
|
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
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
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
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
---
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
## 🚀 Quick Start
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
### Installation
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
```bash
|
|
56
|
+
npm install apexify
|
|
57
|
+
```
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
### Basic Usage
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
```typescript
|
|
62
|
+
import { ApexPainter } from 'apexify';
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
const painter = new ApexPainter();
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
+
[](https://discord.gg/CS2NRSPyze)
|
|
344
|
+
[](https://discord.gg/94qUZWhwFE)
|
|
345
|
+
[](https://discord.gg/83XcjD8vgW)
|
|
346
|
+
|
|
347
|
+
### Documentation & Resources
|
|
348
|
+
|
|
349
|
+
[](http://apexifyjs.jedi-studio.com)
|
|
350
|
+
[](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>
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { PathLike } from "fs";
|
|
2
|
+
import { OutputFormat, CanvasConfig, TextProperties, ImageProperties, GIFOptions, GIFResults, CustomOptions, cropOptions, Frame, ExtractFramesOptions, ResizeOptions, MaskOptions, BlendOptions } from "./utils/utils";
|
|
3
|
+
interface CanvasResults {
|
|
4
|
+
buffer: Buffer;
|
|
5
|
+
canvas: CanvasConfig;
|
|
6
|
+
}
|
|
7
|
+
export declare class ApexPainter {
|
|
8
|
+
#private;
|
|
9
|
+
private format?;
|
|
10
|
+
constructor({ type }?: OutputFormat);
|
|
11
|
+
/**
|
|
12
|
+
* Creates a canvas with the given configuration.
|
|
13
|
+
* Applies rotation, shadow, border effects, background, and stroke.
|
|
14
|
+
*
|
|
15
|
+
* @param canvas - Canvas configuration object containing:
|
|
16
|
+
* - width: Canvas width in pixels
|
|
17
|
+
* - height: Canvas height in pixels
|
|
18
|
+
* - x: X position offset (default: 0)
|
|
19
|
+
* - y: Y position offset (default: 0)
|
|
20
|
+
* - colorBg: Solid color background (hex, rgb, rgba, hsl, etc.)
|
|
21
|
+
* - gradientBg: Gradient background configuration
|
|
22
|
+
* - customBg: Custom background image buffer
|
|
23
|
+
* - zoom: Canvas zoom level (default: 1)
|
|
24
|
+
* - pattern: Pattern background configuration
|
|
25
|
+
* - noise: Noise effect configuration
|
|
26
|
+
*
|
|
27
|
+
* @returns Promise<CanvasResults> - Object containing canvas buffer and configuration
|
|
28
|
+
*
|
|
29
|
+
* @throws Error if canvas configuration is invalid or conflicting
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const result = await painter.createCanvas({
|
|
34
|
+
* width: 800,
|
|
35
|
+
* height: 600,
|
|
36
|
+
* colorBg: '#ffffff',
|
|
37
|
+
* zoom: 1.5
|
|
38
|
+
* });
|
|
39
|
+
* const buffer = result.buffer;
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
createCanvas(canvas: CanvasConfig): Promise<CanvasResults>;
|
|
43
|
+
/**
|
|
44
|
+
* Draws one or more images (or shapes) on an existing canvas buffer.
|
|
45
|
+
*
|
|
46
|
+
* @param images - Single ImageProperties object or array of ImageProperties containing:
|
|
47
|
+
* - source: Image path/URL/Buffer or ShapeType ('rectangle', 'circle', etc.)
|
|
48
|
+
* - x: X position on canvas
|
|
49
|
+
* - y: Y position on canvas
|
|
50
|
+
* - width: Image/shape width (optional, defaults to original size)
|
|
51
|
+
* - height: Image/shape height (optional, defaults to original size)
|
|
52
|
+
* - inherit: Use original image dimensions (boolean)
|
|
53
|
+
* - fit: Image fitting mode ('fill', 'contain', 'cover', 'scale-down', 'none')
|
|
54
|
+
* - align: Image alignment ('center', 'start', 'end')
|
|
55
|
+
* - rotation: Rotation angle in degrees (default: 0)
|
|
56
|
+
* - opacity: Opacity level 0-1 (default: 1)
|
|
57
|
+
* - blur: Blur radius in pixels (default: 0)
|
|
58
|
+
* - borderRadius: Border radius or 'circular' (default: 0)
|
|
59
|
+
* - borderPosition: Border position ('all', 'top', 'bottom', 'left', 'right')
|
|
60
|
+
* - filters: Array of image filters to apply
|
|
61
|
+
* - shape: Shape properties (when source is a shape)
|
|
62
|
+
* - shadow: Shadow configuration
|
|
63
|
+
* - stroke: Stroke configuration
|
|
64
|
+
* - boxBackground: Background behind image/shape
|
|
65
|
+
*
|
|
66
|
+
* @param canvasBuffer - Existing canvas buffer (Buffer) or CanvasResults object
|
|
67
|
+
*
|
|
68
|
+
* @returns Promise<Buffer> - Updated canvas buffer in PNG format
|
|
69
|
+
*
|
|
70
|
+
* @throws Error if source, x, or y are missing
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const result = await painter.createImage([
|
|
75
|
+
* {
|
|
76
|
+
* source: 'rectangle',
|
|
77
|
+
* x: 100, y: 100,
|
|
78
|
+
* width: 200, height: 150,
|
|
79
|
+
* shape: { fill: true, color: '#ff6b6b' },
|
|
80
|
+
* shadow: { color: 'rgba(0,0,0,0.3)', offsetX: 5, offsetY: 5, blur: 10 }
|
|
81
|
+
* }
|
|
82
|
+
* ], canvasBuffer);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
createImage(images: ImageProperties | ImageProperties[], canvasBuffer: CanvasResults | Buffer): Promise<Buffer>;
|
|
86
|
+
/**
|
|
87
|
+
* Creates text on an existing canvas buffer with enhanced styling options.
|
|
88
|
+
*
|
|
89
|
+
* @param textArray - Single TextProperties object or array of TextProperties containing:
|
|
90
|
+
* - text: Text content to render (required)
|
|
91
|
+
* - x: X position on canvas (required)
|
|
92
|
+
* - y: Y position on canvas (required)
|
|
93
|
+
* - fontPath: Path to custom font file (.ttf, .otf, .woff, etc.)
|
|
94
|
+
* - fontName: Custom font name (used with fontPath)
|
|
95
|
+
* - fontSize: Font size in pixels (default: 16)
|
|
96
|
+
* - fontFamily: Font family name (e.g., 'Arial', 'Helvetica')
|
|
97
|
+
* - bold: Make text bold (boolean)
|
|
98
|
+
* - italic: Make text italic (boolean)
|
|
99
|
+
* - underline: Add underline decoration (boolean)
|
|
100
|
+
* - overline: Add overline decoration (boolean)
|
|
101
|
+
* - strikethrough: Add strikethrough decoration (boolean)
|
|
102
|
+
* - highlight: Highlight text with background color and opacity
|
|
103
|
+
* - lineHeight: Line height multiplier (default: 1.4)
|
|
104
|
+
* - letterSpacing: Space between letters in pixels
|
|
105
|
+
* - wordSpacing: Space between words in pixels
|
|
106
|
+
* - maxWidth: Maximum width for text wrapping
|
|
107
|
+
* - maxHeight: Maximum height for text (truncates with ellipsis)
|
|
108
|
+
* - textAlign: Horizontal text alignment ('left', 'center', 'right', 'start', 'end')
|
|
109
|
+
* - textBaseline: Vertical text baseline ('alphabetic', 'bottom', 'hanging', 'ideographic', 'middle', 'top')
|
|
110
|
+
* - color: Text color (hex, rgb, rgba, hsl, etc.)
|
|
111
|
+
* - gradient: Gradient fill for text
|
|
112
|
+
* - opacity: Text opacity (0-1, default: 1)
|
|
113
|
+
* - glow: Text glow effect with color, intensity, and opacity
|
|
114
|
+
* - shadow: Text shadow effect with color, offset, blur, and opacity
|
|
115
|
+
* - stroke: Text stroke/outline with color, width, gradient, and opacity
|
|
116
|
+
* - rotation: Text rotation in degrees
|
|
117
|
+
*
|
|
118
|
+
* @param canvasBuffer - Existing canvas buffer (Buffer) or CanvasResults object
|
|
119
|
+
*
|
|
120
|
+
* @returns Promise<Buffer> - Updated canvas buffer in PNG format
|
|
121
|
+
*
|
|
122
|
+
* @throws Error if text, x, or y are missing, or if canvas buffer is invalid
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* const result = await painter.createText([
|
|
127
|
+
* {
|
|
128
|
+
* text: "Hello World!",
|
|
129
|
+
* x: 100, y: 100,
|
|
130
|
+
* fontSize: 24,
|
|
131
|
+
* bold: true,
|
|
132
|
+
* color: '#ff6b6b',
|
|
133
|
+
* shadow: { color: 'rgba(0,0,0,0.3)', offsetX: 2, offsetY: 2, blur: 4 },
|
|
134
|
+
* underline: true,
|
|
135
|
+
* highlight: { color: '#ffff00', opacity: 0.3 }
|
|
136
|
+
* }
|
|
137
|
+
* ], canvasBuffer);
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
createText(textArray: TextProperties | TextProperties[], canvasBuffer: CanvasResults | Buffer): Promise<Buffer>;
|
|
141
|
+
createCustom(options: CustomOptions[], buffer: CanvasResults | Buffer): Promise<Buffer>;
|
|
142
|
+
createGIF(gifFrames: {
|
|
143
|
+
background: string;
|
|
144
|
+
duration: number;
|
|
145
|
+
}[], options: GIFOptions): Promise<GIFResults | any>;
|
|
146
|
+
resize(resizeOptions: ResizeOptions): Promise<Buffer<ArrayBufferLike>>;
|
|
147
|
+
imgConverter(source: string, newExtension: string): Promise<Buffer<ArrayBufferLike>>;
|
|
148
|
+
effects(source: string, filters: any[]): Promise<Buffer<ArrayBufferLike>>;
|
|
149
|
+
colorsFilter(source: string, filterColor: any, opacity?: number): Promise<any>;
|
|
150
|
+
colorAnalysis(source: string): Promise<{
|
|
151
|
+
color: string;
|
|
152
|
+
frequency: string;
|
|
153
|
+
}[]>;
|
|
154
|
+
colorsRemover(source: string, colorToRemove: {
|
|
155
|
+
red: number;
|
|
156
|
+
green: number;
|
|
157
|
+
blue: number;
|
|
158
|
+
}): Promise<Buffer<ArrayBufferLike> | undefined>;
|
|
159
|
+
removeBackground(imageURL: string, apiKey: string): Promise<Buffer<ArrayBufferLike> | undefined>;
|
|
160
|
+
blend(layers: {
|
|
161
|
+
image: string | Buffer;
|
|
162
|
+
blendMode: 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop' | 'lighter' | 'copy' | 'xor' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
|
|
163
|
+
position?: {
|
|
164
|
+
x: number;
|
|
165
|
+
y: number;
|
|
166
|
+
};
|
|
167
|
+
opacity?: number;
|
|
168
|
+
}[], baseImageBuffer: Buffer, defaultBlendMode?: 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop' | 'lighter' | 'copy' | 'xor' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity'): Promise<Buffer>;
|
|
169
|
+
createChart(data: any, type: {
|
|
170
|
+
chartType: string;
|
|
171
|
+
chartNumber: number;
|
|
172
|
+
}): Promise<Buffer<ArrayBufferLike> | undefined>;
|
|
173
|
+
cropImage(options: cropOptions): Promise<Buffer>;
|
|
174
|
+
private drawImage;
|
|
175
|
+
extractFrames(videoSource: string | Buffer, options: ExtractFramesOptions): Promise<any[]>;
|
|
176
|
+
masking(source: string | Buffer | PathLike | Uint8Array, maskSource: string | Buffer | PathLike | Uint8Array, options?: MaskOptions): Promise<Buffer>;
|
|
177
|
+
gradientBlend(source: string | Buffer | PathLike | Uint8Array, options: BlendOptions): Promise<Buffer>;
|
|
178
|
+
animate(frames: Frame[], defaultDuration: number, defaultWidth?: number, defaultHeight?: number, options?: {
|
|
179
|
+
gif?: boolean;
|
|
180
|
+
gifPath?: string;
|
|
181
|
+
onStart?: () => void;
|
|
182
|
+
onFrame?: (index: number) => void;
|
|
183
|
+
onEnd?: () => void;
|
|
184
|
+
}): Promise<Buffer[] | undefined>;
|
|
185
|
+
validHex(hexColor: string): any;
|
|
186
|
+
outPut(results: any): Promise<void | Buffer | string | Blob | Object | HTMLCanvasElement>;
|
|
187
|
+
}
|
|
188
|
+
export {};
|
|
189
|
+
//# sourceMappingURL=ApexPainter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApexPainter.d.ts","sourceRoot":"","sources":["../../../lib/Canvas/ApexPainter.ts"],"names":[],"mappings":"AAKA,OAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAc,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAGC,KAAK,EACrH,oBAAoB,EAAa,aAAa,EAAE,WAAW,EAAE,YAAY,EAIzF,MAAM,eAAe,CAAC;AAKzB,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;CACtB;AAGH,qBAAa,WAAW;;IACtB,OAAO,CAAC,MAAM,CAAC,CAAe;gBAElB,EAAE,IA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