Developer Guide

Build MODs for me:DERU

Create visual effects that plug into the me:DERU Studio. Convert your standalone code into a MOD using EFX LAB.

▶ Open EFX LAB Read the Guide ↓

01 — Overview

me:DERU — multi layer module EFX

me:DERU consists of two editors: layer-style DERU and node-style NODE. Add various effects through MODs.

📑
DERU
Layer-style editor
+
🔀
NODE
Node-style editor
+
MOD
EFX Modules

What is a MOD?

Like Atelier's materials, each MOD contains artist-created code. A MOD is a magic box full of possibilities.

Pure Processing

Your MOD is a single function. Input goes in, output comes out. No DOM, no state, no side effects.

🎛️

Parameters

Define sliders, toggles and selectors. Users adjust them in the Studio — your code receives the values.

🔌

DERU & NODE Ready

MOD programs work in both DERU and NODE editors. Create art and MINT it as your output.

🔐

NFT Tokengate

MODs are sold as NFTs. Owning them unlocks additional features as tokengate-protected modules.


02 — Pipeline

How MODs Work

Every MOD follows the same Input → Effect → Output pattern. Your function receives pixel data and transforms it.

🖼️
SOURCE
Image pixels (RGBA)
⚙️
YOUR MOD
processPixels()
📤
OUTPUT
Modified pixels
your-effect.js JavaScript
function yourEffect(data, width, height, params, canvas, ctx) {
    // data   — Uint8ClampedArray: RGBA pixel data
    // width  — number: image width
    // height — number: image height
    // params — object: { key: value } from sliders
    // canvas — HTMLCanvasElement
    // ctx    — CanvasRenderingContext2D

    for (let i = 0; i < data.length; i += 4) {
        const r = data[i], g = data[i+1], b = data[i+2];
        // ... your effect logic ...
        data[i] = newR;
        data[i+1] = newG;
        data[i+2] = newB;
    }
}
💡
Two approaches: Modify data[] directly for pixel filters, or draw on canvas/ctx for text/drawing effects (then read back into data).

03 — EFX LAB

Your Development Sandbox

EFX LAB is a standalone tool for prototyping MODs. Write code, drop an image, and see the result instantly.

📂

1. Load Image

Drag & drop an image onto the Source node, or click to browse. This becomes your INPUT.

✏️

2. Write Code

Write your effect function in the code editor. Use templates (Grayscale, Pixelate, Kanji) as starting points.

🎛️

3. Auto Parameters

Write params.xxx||default in your code — sliders are generated automatically with correct ranges.

▶️

4. Run (⌘+Enter)

Press Run or Cmd+Enter. The result appears in the MOD and Output nodes. Click to zoom in.

🔧
Auto-detect: Parameters are scanned from your code automatically when you type. Write params.contrast||100 and a slider (0–200, default 100) appears instantly.
▶ Open EFX LAB

03.5 — AI ASSIST

✦ AI-Powered Code Generation

EFX LAB includes an AI assistant powered by Gemini. Describe the effect you want in natural language — the AI generates the processPixels code for you.

🗣️
YOUR WORDS
「セピア風のエフェクト」
AI ASSIST
Gemini 2.0 Flash
📝
CODE
processPixels()
🗣️

Natural Language Input

Type in any language: 「グリッチエフェクト」, "sepia tone filter", "pixel art style" — the AI understands context.

One-Click Apply

✦ APPLY TO EDITOR injects the code into the editor. ▶ APPLY & RUN applies and runs immediately.

🔄

Iterative Refinement

Continue the conversation: 「もっとコントラスト強く」, 「add noise」 — the AI remembers your previous request.

🔒

Safe Code Only

The AI is constrained to generate only pixel processing code. No eval, fetch, DOM access, or external requests.

Example Prompts

PromptResult
セピア風のエフェクトWarm sepia tone filter with adjustable intensity
pixel art mosaicPixelation effect with block size parameter
グリッチ効果をつけてRGB split + scanline glitch effect
watercolor paintingSoft blur + edge detection watercolor simulation
ネオン光るエッジ検出Edge detection with neon glow effect
vaporwave aestheticPurple/pink color shift + scan lines + chromatic aberration
🧠
Conversational: The AI maintains conversation history within a session. Ask for modifications like 「add a parameter for blur amount」 or 「make the colors more intense」 and it will update the code accordingly.
🗣️
DESCRIBE
Type effect idea
GENERATE
AI creates code
APPLY & RUN
One-click preview
🔄
REFINE
Iterate via chat

04 — Convert

From Standalone Code to MOD

If you have an existing HTML effect, here's how to extract the core algorithm into a MOD function.

1

Identify the Core Algorithm

Find the pixel processing logic in your code. Ignore all UI, file I/O, download, and state management code. Keep only the math.

2

Map Controls to Params

Replace document.getElementById('slider').value with params.sliderName||defaultValue. Each slider becomes a param key.

3

Write the Function

Wrap your algorithm in: function myEffect(data, width, height, params, canvas, ctx) { ... }

4

Test in EFX LAB

Paste your function into the code editor, load an image, and press Run. Adjust params until the effect works correctly.

Conversion Patterns

PatternWhenHow
Pixel Filter Color adjustments, contrast, etc. Modify data[i] in a loop
Spatial/Neighbor Blur, sharpen, edge detect Copy data first, read from copy, write to data
Canvas Overlay Text, shapes on top Put data on canvas, draw, read back
Full Canvas Replace Kanji art, ASCII art Render to canvas from scratch, read into data
⚠️
Remove all: DOM access, event listeners, file I/O, state globals, theme toggles, download buttons. Your MOD is only the processing function.

05 — Submit

Publishing Your MOD

Once your effect works in EFX LAB, submit it for review and integration into the me:DERU platform.

🎨
Prototype
Build & test in EFX LAB
📨
Submit
Send code via Discord
🔍
Review
Security & quality check
🔧
Integrate
Convert to TS module
🚀
Deploy
Live on me:DERU
🔒
Security: All MOD code is reviewed before deployment. MODs run in users' browsers, so no external requests, no DOM access, and no wallet interaction is permitted.

What to Submit

📄

Effect Code

Your function myEffect(data, width, height, params, canvas, ctx) — the core algorithm.

📝

Description

MOD name, brief description, your artist name, and any notes on parameters or usage.

🖼️

Sample Output

A screenshot or image showing the effect applied. This helps during review.


06 — Reference

Quick Reference

Function Arguments

ArgumentTypeDescription
dataUint8ClampedArrayRGBA pixel data — 4 bytes per pixel (R, G, B, A). Modify in-place for output.
widthnumberImage width in pixels
heightnumberImage height in pixels
paramsobjectParameter values from sliders: { contrast: 100, gamma: 1.0, ... }
canvasHTMLCanvasElementOutput canvas — same dimensions as input image
ctxCanvasRenderingContext2DCanvas 2D context for drawing operations

Auto-Detected Parameter Ranges

Param NameMinMaxStep
contrast02001
brightness02001
gamma0.150.1
fontSize2481
charWidth102001
pixelSize1641
threshold02551
opacity01001
angle03601
invert011

Pixel Data Layout

pixel-layout.js Reference
// Each pixel = 4 consecutive values in the data array
// data[i]   = Red   (0-255)
// data[i+1] = Green (0-255)
// data[i+2] = Blue  (0-255)
// data[i+3] = Alpha (0-255)

// Get pixel at (x, y):
const i = (y * width + x) * 4;
const r = data[i], g = data[i+1], b = data[i+2], a = data[i+3];

// Grayscale conversion:
const gray = r * 0.3 + g * 0.59 + b * 0.11;

07 — Future Plan

GIF & Video Support

The current MOD architecture processes one frame at a time — which means it's inherently ready for video and GIF processing with no code changes.

🎬
GIF / VIDEO
Frame decompose
MOD × N
Apply per frame
📤
OUTPUT
GIF / WebP / MP4
🎞️
No MOD changes needed. Existing MODs will work with video automatically. The pipeline decomposes frames, applies your MOD to each, and re-encodes the output.

Extended Frame Parameters

Future MODs will receive additional timing information through params, enabling time-based animations:

ParamTypeDescription
params.frameIndexnumberCurrent frame number (0, 1, 2, ...)
params.totalFramesnumberTotal number of frames
params.progressnumberProgress ratio (0.0 → 1.0)
time-based-effect.js Future
function fadeEffect(data, width, height, params, canvas, ctx) {
    const t = params.progress || 0;  // 0.0 → 1.0 over time

    for (let i = 0; i < data.length; i += 4) {
        // Effect that evolves across frames
        data[i]   *= (1 - t * 0.5);  // Gradual color shift
        data[i+1] *= (1 - t * 0.3);
        data[i+2] *= (1 + t * 0.2);
    }
}
🔄

Backward Compatible

MODs that don't use frame params will apply the same effect to every frame — instant GIF filter.

🎨

Time-Based Effects

Use params.progress to create effects that evolve over time — glitch, fade, morph, reveal.