editmamei 1.7.1 → 1.8.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 +3 -3
- package/dist/backends/gimp/bridge/lib.py +833 -4
- package/dist/backends/gimp/bridge/ops.py +1943 -110
- package/dist/bin/editmamei-core-darwin-arm64 +0 -0
- package/dist/bin/editmamei-core-darwin-x64 +0 -0
- package/dist/bin/editmamei-core-win-x64.exe +0 -0
- package/dist/cli/config.js +7 -0
- package/dist/core/settings.js +7 -0
- package/dist/core/tool-activity.js +13 -1
- package/dist/core/tool-groups.js +7 -1
- package/dist/core/tool-tiers.js +7 -1
- package/dist/modules/gimp/index.js +8 -2
- package/dist/skills/editmamei-skill.zip +0 -0
- package/dist/telemetry/sanitize.js +15 -1
- package/dist/tools/adjustment-tools.js +9 -1
- package/dist/tools/document-tools.js +50 -9
- package/dist/tools/filter-tools.js +2 -1
- package/dist/tools/gimp-adjustment-tools.js +3 -3
- package/dist/tools/gimp-core-tools.js +7 -8
- package/dist/tools/gimp-document-tools.js +4 -1
- package/dist/tools/gimp-effect-tools.js +2 -2
- package/dist/tools/gimp-geometry-tools.js +2 -2
- package/dist/tools/gimp-inspect-tools.js +35 -5
- package/dist/tools/gimp-layer-tools.js +5 -24
- package/dist/tools/gimp-match-tools.js +133 -0
- package/dist/tools/gimp-selection-tools.js +374 -0
- package/dist/tools/gimp-shared.js +12 -0
- package/dist/tools/gimp-text-tools.js +181 -0
- package/dist/tools/gimp-transform-layer-tools.js +215 -0
- package/dist/tools/gimp-verify-tools.js +2 -13
- package/dist/tools/image-placement-tools.js +6 -1
- package/dist/tools/sky-tools.js +2 -1
- package/dist/utils/gimp-path.js +18 -22
- package/dist/utils/local-path.js +99 -0
- package/dist/utils/operation-timeouts.js +7 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/tools/gimp-mask-tools.js +0 -102
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { GIMP_IMAGE_PROP, runGimpTool } from './gimp-shared.js';
|
|
2
|
-
const createMaskSchema = {
|
|
3
|
-
type: 'object',
|
|
4
|
-
properties: {
|
|
5
|
-
image: GIMP_IMAGE_PROP,
|
|
6
|
-
type: {
|
|
7
|
-
type: 'string',
|
|
8
|
-
enum: ['rectangle', 'ellipse', 'gradient_linear', 'gradient_radial'],
|
|
9
|
-
description: 'rectangle/ellipse: geometric selection (needs x, y, width, height). gradient_linear: a ' +
|
|
10
|
-
'ramp from (x1,y1) to (x2,y2), default the full image width. gradient_radial: a ramp from ' +
|
|
11
|
-
'full effect at the center (cx,cy) fading to none at radius, default centered at the ' +
|
|
12
|
-
"image's own center with radius = half the shorter side.",
|
|
13
|
-
},
|
|
14
|
-
name: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
default: 'Mask',
|
|
17
|
-
description: 'Channel name — replaces any existing channel of the same name (refused if that name is ' +
|
|
18
|
-
"already used as an existing filter's mask). Pass this name to gimp_add_adjustment's " +
|
|
19
|
-
'`mask` field to confine a new filter to it.',
|
|
20
|
-
},
|
|
21
|
-
invert: {
|
|
22
|
-
type: 'boolean',
|
|
23
|
-
default: false,
|
|
24
|
-
description: 'rectangle/ellipse: invert the selection. gradient_linear/gradient_radial: swap which end ' +
|
|
25
|
-
'is black vs white.',
|
|
26
|
-
},
|
|
27
|
-
feather_px: {
|
|
28
|
-
type: 'number',
|
|
29
|
-
minimum: 0,
|
|
30
|
-
maximum: 1000,
|
|
31
|
-
default: 0,
|
|
32
|
-
description: 'rectangle/ellipse only. Feather radius in pixels. No effect on a gradient (already continuous).',
|
|
33
|
-
},
|
|
34
|
-
x: { type: 'number', description: 'rectangle/ellipse: left edge, document pixels.' },
|
|
35
|
-
y: { type: 'number', description: 'rectangle/ellipse: top edge, document pixels.' },
|
|
36
|
-
width: { type: 'number', description: 'rectangle/ellipse: width, document pixels.' },
|
|
37
|
-
height: { type: 'number', description: 'rectangle/ellipse: height, document pixels.' },
|
|
38
|
-
x1: { type: 'number', description: 'gradient_linear: start point x. Default 0.' },
|
|
39
|
-
y1: { type: 'number', description: 'gradient_linear: start point y. Default 0.' },
|
|
40
|
-
x2: { type: 'number', description: "gradient_linear: end point x. Default the image's width." },
|
|
41
|
-
y2: { type: 'number', description: 'gradient_linear: end point y. Default 0.' },
|
|
42
|
-
cx: {
|
|
43
|
-
type: 'number',
|
|
44
|
-
description: "gradient_radial: center x. Default the image's own center.",
|
|
45
|
-
},
|
|
46
|
-
cy: {
|
|
47
|
-
type: 'number',
|
|
48
|
-
description: "gradient_radial: center y. Default the image's own center.",
|
|
49
|
-
},
|
|
50
|
-
radius: {
|
|
51
|
-
type: 'number',
|
|
52
|
-
description: 'gradient_radial: radius, document pixels. Default half the shorter image side.',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
required: ['image', 'type'],
|
|
56
|
-
};
|
|
57
|
-
export function createGimpMaskTools(gimp) {
|
|
58
|
-
return [
|
|
59
|
-
{
|
|
60
|
-
tool: {
|
|
61
|
-
name: 'gimp_create_mask',
|
|
62
|
-
description: 'Headless GIMP: build a geometric mask (rectangle / ellipse / linear or radial gradient) ' +
|
|
63
|
-
'into a NAMED channel. The active selection is CLEARED when this call returns — it does ' +
|
|
64
|
-
'NOT leave the mask selected the way a Photoshop selection would. Pass the returned ' +
|
|
65
|
-
"`channel` name to gimp_add_adjustment's `mask` field WHEN CREATING a new filter — that " +
|
|
66
|
-
"is the ONLY way to apply it — a filter's mask is fixed at creation and cannot be " +
|
|
67
|
-
'changed on a re-edit. Order matters: straighten / flip / resize the canvas FIRST (see ' +
|
|
68
|
-
'gimp_transform_canvas, gimp_resize_image), then crop, then create masks and masked ' +
|
|
69
|
-
'adjustments — rotate, flip, and resize all refuse outright once ANY masked adjustment ' +
|
|
70
|
-
'filter exists on the image, or any filter not created by Editmamei (for example one ' +
|
|
71
|
-
'added in the GIMP GUI).',
|
|
72
|
-
inputSchema: createMaskSchema,
|
|
73
|
-
outputSchema: {
|
|
74
|
-
type: 'object',
|
|
75
|
-
properties: {
|
|
76
|
-
channel: { type: 'string' },
|
|
77
|
-
selected_pixels: { type: 'number' },
|
|
78
|
-
fraction: { type: 'number' },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
annotations: {
|
|
82
|
-
title: 'Create GIMP Mask',
|
|
83
|
-
readOnlyHint: false,
|
|
84
|
-
destructiveHint: true,
|
|
85
|
-
idempotentHint: false,
|
|
86
|
-
openWorldHint: true,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
handler: async (args) => runGimpTool({
|
|
90
|
-
gimp,
|
|
91
|
-
rawArgs: args,
|
|
92
|
-
schema: createMaskSchema,
|
|
93
|
-
op: 'create_mask',
|
|
94
|
-
errorPrefix: 'Error creating GIMP mask',
|
|
95
|
-
successText: (result) => {
|
|
96
|
-
const r = result;
|
|
97
|
-
return `Created mask channel "${r.channel}" — ${(r.fraction * 100).toFixed(1)}% of pixels selected.`;
|
|
98
|
-
},
|
|
99
|
-
}),
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
}
|