Back to skills
SKILL.md
Riteink
ASecurity血红纸和绛黑墨构成的暗黑版画风,适合对称图腾、暗黑海报与缠绕纹章。粗边墨块里留红色刻痕,配合干刷、滴墨、尖刺光环和丝网网点。
- 2 stars
- 0 votes
- 0 copies
- 1 view
- Added November 21, 2026
Works with
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add VITASID57/stingink --skill riteink --agent claude-codeAre you the author of Riteink?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vitasid57-riteink)---
name: riteink
description: 血红纸和绛黑墨构成的暗黑版画风,适合对称图腾、暗黑海报与缠绕纹章。粗边墨块里留红色刻痕,配合干刷、滴墨、尖刺光环和丝网网点。
---
# riteink · 暗黑祭墨图腾
血红纸上压一层绛黑墨,干刷的缝和红色刻痕让纸色从墨里透出来。画面下缘挂着滴墨,再覆一层粗网点,像丝网印的祭祀海报。绘制依赖 Python、Pillow、NumPy 和 SciPy,示例使用固定种子。
## 用纸缝组织图腾
先定中轴,再安排能从红纸上辨出轮廓的墨块。蛇蝎图腾用举起的钳撑开上半张,蛇身在下方绕出纸缝,光环压到主体背后。看参考图时可以观察墨块之间的疏密,再用纸缝安排自己的符号和穿插关系。
## 画面语法
1. **双色**:血红纸配绛紫黑墨,别的颜色只留给眼睛(几颗发光的点)。
2. **粗砺墨块**:形状的边被噪声啃得参差不齐,墨层里透出斑驳的红。
3. **干刷**:一笔里有很多根刷毛,越往后越干、越容易断,边上的刷毛最先断。
4. **刻痕**:结构不用勾线,而是在墨块里用红色细线刻出来,比如甲壳缝、鳞片、肌理。
5. **滴淌**:墨从形体底部往下淌,末端挂一颗小珠;红色的滴可以淌在黑色上。
6. **丝网印刷**:最后压一层规则网点,再加粗颗粒和黑斑点。
7. **穿插留纸缝**:两个墨块交叠时,压在上面的那个外圈留一道红纸缝,这样才分得出前后。
## 构图原则
- **中轴对称**是图腾的骨架。左右两侧用同一套参数镜像(`for s in (-1, 1)`),中轴上只放一个主体。
- 主体上方放光环或尖刺,底下放祭台或基座,再让墨从祭台往下淌。
- 两种生物缠绕时,用正弦螺旋去绕另一个生物的长轴,按 `cos(相位)>0` 把螺旋分成前段和后段:后段先画,再画被缠的主体,最后画前段并加 `gap`。
## 引擎函数表(riteink_lib.py)
| 函数 | 用途 | 常用参数 |
|---|---|---|
| `Canvas(w, h, seed)` | 血红纸,自带斑驳 | |
| `C.mask()` / `C.arr()` / `C.blur()` / `C.noise()` | 工具 | |
| `C.fill(m, color, ragged, bite, mottle, gap)` | 核心:粗砺墨块 | `bite` 边缘被啃的程度,`mottle` 墨里透红的多少,`gap` 外圈留的纸缝宽度 |
| `C.tube(pts, w0, w1)` | 沿路径生成渐变粗细的管子遮罩,同时返回法线和半宽 | 蛇身、尾节、腿、钳指都用它 |
| `C.drybrush(pts, width, dry, taper)` | 干刷 | `dry` 越大越断,`taper=(头, 尾)` 宽度比例 |
| `C.scratch(pts, width)` | 在墨里刻红线 | `alpha` 0.5–0.9 |
| `C.drip(x, y, length, width, color)` | 滴淌 | `color=PAL["cut"]` 时是红滴 |
| `C.spikes(cx, cy, r0, r1, n)` | 尖刺光环 | |
| `C.rings(cx, cy, radii)` | 暗红涡环 | |
| `C.glow_eye(x, y, r, color)` | 发光的眼(全图唯一的彩色) | `PAL["gold"]`,或红色 |
| `C.finish(path, screen, grain, specks)` | 丝网网点 + 颗粒 + 黑斑 | `screen` 网点间距 |
| `bez / rot / mirror` | 几何 | |
## 画的顺序
涡环 → 光环(尖刺 → 用纸色挖空中心 → 描环)→ 祭台干刷 → 滴淌 → 缠绕物的后段 → 主体(gap 6–8)→ 缠绕物的前段(gap 7)→ 四肢、钳子 → 头胸 → 刻痕 → 头部、眼睛 → 补几道滴淌 → `finish`
## 部件配方
- **蛇身**:`tube` 加 V 形鳞刻痕。沿路径每隔 6 个点,用法线和切线拼一个 V,用 `scratch` 刻。
- **蛇头**:8 个点的多边形,后脑宽、吻部长,朝向用 `f = -s` 指向中轴。一颗金色 `glow_eye`,信子用细的 `drybrush` 伸向中轴。
- **蝎子**:头胸甲是六边形,背甲是七个椭圆叠成的,所有分节都用弧形 `scratch` 刻出来,中轴再刻一道脊线。腿每条三段 `tube`,从粗到细,`gap=3`。
- **蝎钳**:钳臂两段 `tube`,钳掌是旋转过的六边形,两根钳指是往上合拢的锥形 `tube`(外侧长、内侧短)。
- **蝎尾**:一串逐节变小的椭圆,每节都加 `gap` 和一道弧形刻痕;末端是毒囊多边形加一根钩状锥管。
## 坑
- `drybrush` 必须先**把路径重采样到每 3px 一个点**(库里已经做了)。只给两个端点的话,刷毛要么整根有要么整根没有,画出来像五线谱。
- 刷毛的粗细要按 `width / 刷毛数` 来算,不然刷毛之间会露缝,画出来像耙子。腿这类细长结构最好直接用 `tube` + `fill`,别用干刷。
- 对称的头要注意朝向:用 `s` 镜像位置,用 `f=-s` 决定"朝里",不然两颗头会背对背。
- 墨块交叠时,压在上面的那个一定要加 `gap`,否则两个黑块会糊成一坨。
- 全图除了眼睛之外不要再加别的颜色,加了就不像了。
- 1200×1500 渲染大约 17 秒。示例脚本要和 lib 放在同一个目录里运行,不能加 `python -I`。
## 示例
双头蛇与蝎子交叠的地方留着细红纸缝,能看清各自的走向。运行 `python3 example_totem.py` 会生成 `example_totem.png`。
如果 skill 目录里没有 `riteink_lib.py`,就把下面的完整代码写进工作目录再用。
```python
"""riteink — 葵久野 × 沈嘟嘟 的暗黑图腾画风引擎
画面语法:
1. 双色:血红纸 + 近黑的绛紫墨,别的颜色只给眼睛
2. 粗砺墨块:形状边缘被噪声啃过,墨里透出斑驳的红
3. 干笔:一笔里有很多根刷毛,越往后越干、越断
4. 刻痕:用红色细线在墨块里"刻"出结构(肌理、鳞、甲壳缝)
5. 滴淌:墨从形体底部往下淌,末端一颗小珠
6. 丝网印刷:最后压一层规则网点 + 粗颗粒,像劣质印刷品
numpy + Pillow + scipy,固定种子,可复现。
"""
import math
import numpy as np
from PIL import Image, ImageDraw, ImageFilter
from scipy.ndimage import gaussian_filter
PAL = {
"paper": (176, 32, 28), # 血红
"paper2": (150, 22, 22), # 暗一档的红(漩涡、光柱)
"ink": (38, 6, 10), # 绛紫黑墨
"cut": (196, 54, 44), # 刻痕红(比纸亮一点)
"eye": (255, 150, 80), # 只给眼睛
"gold": (240, 196, 90), # 金瞳
}
class Canvas:
def __init__(self, w, h, seed=7):
self.w, self.h = w, h
self.rng = np.random.default_rng(seed)
self.yy, self.xx = np.mgrid[0:h, 0:w].astype(np.float32)
self.img = np.zeros((h, w, 3), np.float32) + PAL["paper"]
# 纸本身的斑驳
blot = self.noise(10, 1.0) + self.noise(40, 0.5)
self.img *= (1 + 0.06 * blot)[..., None]
self.edge_noise = self.noise(60, 1.0) + self.noise(180, 0.8) + self.rng.standard_normal((h, w)).astype(np.float32) * 0.5
self.mottle = self.noise(90, 1.0) + self.rng.standard_normal((h, w)).astype(np.float32) * 0.8
# ------------------------------------------------ 工具
def blur(self, a, r):
return gaussian_filter(np.asarray(a, np.float32), r, mode="nearest")
def noise(self, cells, amp=1.0):
gh = max(2, int(cells * self.h / self.w) + 2)
g = self.rng.standard_normal((gh, cells + 2)).astype(np.float32)
return np.asarray(Image.fromarray(g).resize((self.w, self.h), Image.BICUBIC), np.float32) * amp
def mask(self):
m = Image.new("L", (self.w, self.h), 0)
return m, ImageDraw.Draw(m)
@staticmethod
def arr(m):
return np.asarray(m, np.float32) / 255.0 if not isinstance(m, np.ndarray) else m
def _blend(self, alpha, color):
a = np.clip(alpha, 0, 1)[..., None]
self.img = self.img * (1 - a) + np.array(color, np.float32) * a
# ------------------------------------------------ 粗砺墨块
def rough(self, m, ragged=3.0, bite=0.18):
"""被噪声啃过的边"""
s = self.blur(self.arr(m), ragged)
return (s + self.edge_noise * bite > 0.5).astype(np.float32)
def fill(self, m, color=PAL["ink"], ragged=3.0, bite=0.18, mottle=0.22, gap=0):
"""墨块。gap>0 时先在外面留一圈纸色,用来做"压在上面"的穿插"""
r = self.rough(m, ragged, bite)
if gap:
g = (self.blur(r, gap * 0.6) > 0.08).astype(np.float32)
self._blend(g, PAL["paper"])
# 墨里透红:斑驳处墨薄
thin = np.clip((self.mottle - 0.9) * 0.5, 0, 1) * mottle * 3
self._blend(r * (1 - np.clip(thin, 0, 0.75)), color)
return r
# ------------------------------------------------ 干笔
def drybrush(self, pts, width, color=PAL["ink"], bristles=None, dry=0.5, taper=(1.0, 0.25), alpha=1.0):
"""沿路径的一笔干刷。dry 越大越断"""
pts = np.array(pts, np.float32)
if len(pts) < 2:
return
seg = np.diff(pts, axis=0)
L = np.concatenate([[0], np.cumsum(np.hypot(seg[:, 0], seg[:, 1]))])
# 重采样:每 3px 一个点,干笔的断续才自然
ns = max(4, int(L[-1] / 3))
Ls = np.linspace(0, L[-1], ns)
pts = np.stack([np.interp(Ls, L, pts[:, 0]), np.interp(Ls, L, pts[:, 1])], 1)
seg = np.diff(pts, axis=0)
L = Ls
total = L[-1] + 1e-6
tang = np.vstack([seg, seg[-1:]])
tang /= (np.hypot(tang[:, 0], tang[:, 1])[:, None] + 1e-6)
nrm = np.stack([-tang[:, 1], tang[:, 0]], 1)
nb = bristles or max(4, int(width / 2.2))
M = Image.new("L", (self.w, self.h), 0)
d = ImageDraw.Draw(M)
for b in range(nb):
o = (b / max(1, nb - 1) - 0.5)
th = max(1.0, width / nb * self.rng.uniform(1.1, 2.0))
ph = self.rng.uniform(0, 100); fq = self.rng.uniform(0.02, 0.06)
start = None
for i in range(len(pts)):
t = L[i] / total
wd = width * (taper[0] + (taper[1] - taper[0]) * t)
p = pts[i] + nrm[i] * o * wd
# 干:越往后越容易断,边缘的刷毛更容易断
v = math.sin(L[i] * fq + ph) * 0.5 + self.rng.uniform(-0.5, 0.5)
on = v > (dry * t * 1.6 - 0.6 + abs(o) * dry)
if on:
if start is not None:
d.line([tuple(start), tuple(p)], fill=255, width=int(round(th)))
start = p
else:
start = None
a = self.arr(M)
a = np.clip(self.blur(a, 0.6) * 1.6, 0, 1) * alpha
self._blend(a, color)
def scratch(self, pts, width=3, color=PAL["cut"], dry=0.3, alpha=0.9):
"""在墨块里刻红线"""
self.drybrush(pts, width, color=color, bristles=max(2, int(width)), dry=dry, taper=(1, 0.3), alpha=alpha)
# ------------------------------------------------ 管子(蛇身、尾节)
def tube(self, pts, w0, w1=None, **kw):
w1 = w0 if w1 is None else w1
pts = np.array(pts, np.float32)
seg = np.diff(pts, axis=0)
tang = np.vstack([seg, seg[-1:]])
tang /= (np.hypot(tang[:, 0], tang[:, 1])[:, None] + 1e-6)
nrm = np.stack([-tang[:, 1], tang[:, 0]], 1)
t = np.linspace(0, 1, len(pts))[:, None]
wd = (w0 + (w1 - w0) * t) / 2
left = pts + nrm * wd; right = pts - nrm * wd
m, d = self.mask()
d.polygon([tuple(p) for p in left] + [tuple(p) for p in right[::-1]], fill=255)
r0 = w0 / 2; r1 = w1 / 2
d.ellipse([pts[0][0] - r0, pts[0][1] - r0, pts[0][0] + r0, pts[0][1] + r0], fill=255)
d.ellipse([pts[-1][0] - r1, pts[-1][1] - r1, pts[-1][0] + r1, pts[-1][1] + r1], fill=255)
return m, nrm, wd[:, 0]
# ------------------------------------------------ 滴淌
def drip(self, x, y, length, width=7, color=PAL["ink"]):
m, d = self.mask()
n = 30
wob = self.rng.uniform(-1, 1)
pts = [(x + wob * math.sin(i / n * 3) * 2, y + length * i / n) for i in range(n + 1)]
for i, (px, py) in enumerate(pts):
r = width * (0.9 - 0.35 * i / n) / 2
d.ellipse([px - r, py - r, px + r, py + r], fill=255)
bx, by = pts[-1]
rb = width * 0.75
d.ellipse([bx - rb, by - rb * 0.9, bx + rb, by + rb * 1.1], fill=255)
self.fill(m, color=color, ragged=1.2, bite=0.08, mottle=0.1)
# ------------------------------------------------ 光环尖刺 / 涡环
def spikes(self, cx, cy, r0, r1, n=14, width=16, jitter=0.25, color=PAL["ink"]):
for k in range(n):
ang = 2 * math.pi * k / n + self.rng.uniform(-0.05, 0.05)
rr = r1 * self.rng.uniform(1 - jitter, 1 + jitter * 0.4)
pts = [(cx + math.cos(ang) * (r0 + (rr - r0) * t), cy + math.sin(ang) * (r0 + (rr - r0) * t)) for t in np.linspace(0, 1, 30)]
self.drybrush(pts, width, color=color, dry=0.35, taper=(1.0, 0.05))
def rings(self, cx, cy, radii, width=3, color=PAL["paper2"], alpha=0.55):
for r in radii:
pts = [(cx + r * math.cos(t), cy + r * math.sin(t)) for t in np.linspace(0, 2 * np.pi, 240)]
self.drybrush(pts, width, color=color, dry=0.25, taper=(1, 1), alpha=alpha)
def glow_eye(self, x, y, r, color=PAL["eye"]):
m, d = self.mask(); d.ellipse([x - r, y - r, x + r, y + r], fill=255)
a = self.arr(m)
self._blend(np.clip(self.blur(a, r * 0.8) * 1.2, 0, 1) * 0.6, color)
self._blend(a, color)
h, hd = self.mask(); hd.ellipse([x - r * 0.35 - r * 0.2, y - r * 0.55, x - r * 0.05, y - r * 0.15], fill=255)
self._blend(self.arr(h), (255, 235, 210))
# ------------------------------------------------ 收尾:丝网印刷
def finish(self, path, screen=3.4, grain=34, specks=0.03, blur=0.45):
img = self.img.copy()
lum = img.mean(2) / 255.0
# 规则网点:亮部点小,暗部点大
ang = math.radians(22)
u = (self.xx * math.cos(ang) + self.yy * math.sin(ang)) * 2 * math.pi / screen
v = (-self.xx * math.sin(ang) + self.yy * math.cos(ang)) * 2 * math.pi / screen
dots = (np.cos(u) + np.cos(v)) * 0.25 + 0.5
img *= (0.78 + 0.34 * dots)[..., None]
# 粗颗粒 + 黑斑点
img += self.rng.standard_normal(img.shape[:2]).astype(np.float32)[..., None] * grain * (0.4 + lum[..., None])
sp = self.rng.random(img.shape[:2]) < specks
img[sp] *= 0.35
out = Image.fromarray(np.clip(img, 0, 255).astype(np.uint8))
if blur:
out = out.filter(ImageFilter.GaussianBlur(blur))
out.save(path, quality=92)
return out
def bez(p0, p1, p2, p3=None, n=60):
t = np.linspace(0, 1, n)[:, None]
p0, p1, p2 = map(np.array, (p0, p1, p2))
if p3 is None:
pts = (1 - t) ** 2 * p0 + 2 * (1 - t) * t * p1 + t ** 2 * p2
else:
p3 = np.array(p3)
pts = (1 - t) ** 3 * p0 + 3 * (1 - t) ** 2 * t * p1 + 3 * (1 - t) * t ** 2 * p2 + t ** 3 * p3
return [tuple(p) for p in pts]
def rot(pts, cx, cy, deg):
a = math.radians(deg); c, s = math.cos(a), math.sin(a)
return [(cx + (x - cx) * c - (y - cy) * s, cy + (x - cx) * s + (y - cy) * c) for x, y in pts]
def mirror(pts, cx):
return [(2 * cx - x, y) for x, y in pts]
```
Files in this skill
- SKILL.md
- example_totem.py
- riteink_lib.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.