feat(image-annotate): v1.15.0 右侧栏「图片调节」11 项 + 快速效果强度修正
用户要「添加基本的图片调节能力到右边栏,同时优化现在的效果,效果现在弱了一些」。 ## 图片调节(新 adjust.js,作用于当前位图图层,默认原图) 曝光 ±100(±2EV)/ 明度 / 对比度 / 阴影 / 高光 / 色相 ±180° / 饱和度 / 温度 / 色调 / 锐度 / 清晰度,单行紧凑布局(240px 侧栏 11 项只占约 240px 高)。 拖滑杆实时预览、松手精细、双击归零、右上全部复位。 ## 为什么走 getImageData 而不是 ctx.filter CSS filter 只有 brightness/contrast/saturate/hue-rotate/blur,做不到: 阴影/高光(要按亮度开软蒙版分区)、白平衡(要 R/B、G/M 通道分别增益)、 锐化(要 USM 卷积)。所以只能逐像素。 ## 性能:拖动降到 900 长边预览,松手才全量 实测全量耗时(边长 / 像素 / 毫秒):800²/0.6M/6.7 · 1200²/1.4M/12.8 · 2000²/4.0M/36.8 · 4000²/16M/144.6。 4000×3000 实测:纯调色全量 64ms;叠锐度 287ms;叠清晰度 343ms; 首次(建 source + preview 缓存)256ms。锐度默认 0,不主动拉就不走 USM。 ## 两个必须守住的坑(都写成用例了) 1. 不叠加:source 存调节前像素,每次从它重算;每层 sourceCache 另存,切层往返 也不会拿「调过的像素」当新基准。 2. 撤销后归零:历史只存像素快照、不存调节基准。撤销还原了像素而滑块还停 +80 的话, 再拖一次就从错误基准算,等于调两遍。规则:撤销一步 = 调整作废、滑块归零、基准重拍。 ## 效果强度 「增强」原 brightness(1.12) contrast(1.1) saturate(1.06),截图对比几乎看不出变化 —— 这就是用户说的「效果弱」。改 1.4 / 1.25 / 1.2;「高对比」contrast 1.4 → 1.6。 回归:harness 199 → 208 全通(新增 9 条),validate 9/9。 踩到的用例坑:① 前面效果用例把原图栅格化并隐藏,调色要先用「还原原图」回到单层; ② 历史栈有容量上限,push 到底后「进一条淘汰一条」,长度永远不变,数标签次数才准。
This commit is contained in:
1 parent
1dc423c025
commit
240d02684a
14 files changed
+1357
-17
No files matched your search
@@ -1946,6 +1946,76 @@
|
||||
.iwb-editor-fx-range:disabled::-moz-range-thumb { background: #585b70; }
|
||||
.iwb-editor-fx-range:focus-visible { outline: 2px solid #89b4fa; outline-offset: 2px; }
|
||||
|
||||
/* ================================================================
|
||||
v1.15:图片调节面板
|
||||
11 项挤在 240px 侧栏里,必须单行紧凑:名称 46 / 滑杆 flex / 数值 36。
|
||||
调过的项把名称染成橙色 —— 一屏 11 项,不标出来根本看不出哪几项被动过。
|
||||
================================================================ */
|
||||
.iwb-editor-adj {
|
||||
display: flex; flex-direction: column; gap: 7px;
|
||||
padding: 9px 10px 8px; border-radius: 10px;
|
||||
background: #1e1e2c; border: 1px solid #2f2f42;
|
||||
}
|
||||
.iwb-editor-adj-head {
|
||||
display: flex; align-items: center; gap: 6px;
|
||||
}
|
||||
.iwb-editor-adj-title {
|
||||
font-size: 11.5px; font-weight: 600; color: #cdd6f4; flex: 0 0 auto;
|
||||
}
|
||||
.iwb-editor-adj-target {
|
||||
font-size: 10px; color: #7f87a3; flex: 1 1 auto;
|
||||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
}
|
||||
.iwb-editor-adj-reset {
|
||||
flex: 0 0 auto; padding: 2px 7px; border-radius: 5px;
|
||||
background: #26263a; border: 1px solid #3a3a52; color: #b9c0d8;
|
||||
font: 500 10px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
|
||||
cursor: pointer; transition: background 0.12s ease, color 0.12s ease;
|
||||
}
|
||||
.iwb-editor-adj-reset:hover:not(:disabled) { background: #33334c; color: #f3dcb0; border-color: #e8a735; }
|
||||
.iwb-editor-adj-reset:disabled { opacity: 0.4; cursor: default; }
|
||||
.iwb-editor-adj.is-dirty .iwb-editor-adj-title { color: #e8a735; }
|
||||
.iwb-editor-adj-list { display: flex; flex-direction: column; gap: 1px; }
|
||||
.iwb-editor-adj-row {
|
||||
display: grid; grid-template-columns: 46px 1fr 36px;
|
||||
align-items: center; gap: 6px; padding: 1px 0;
|
||||
}
|
||||
.iwb-editor-adj-name {
|
||||
font-size: 10px; color: #b9c0d8; white-space: nowrap;
|
||||
cursor: pointer; user-select: none; overflow: hidden; text-overflow: ellipsis;
|
||||
}
|
||||
.iwb-editor-adj-row.is-set .iwb-editor-adj-name { color: #e8a735; }
|
||||
.iwb-editor-adj-range {
|
||||
-webkit-appearance: none; appearance: none;
|
||||
width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer;
|
||||
}
|
||||
.iwb-editor-adj-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #313244; }
|
||||
.iwb-editor-adj-range::-webkit-slider-thumb {
|
||||
-webkit-appearance: none; appearance: none;
|
||||
width: 11px; height: 11px; margin-top: -3.5px; border-radius: 50%;
|
||||
background: #e8a735; border: 1px solid #1e1e2c;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
.iwb-editor-adj-range::-moz-range-track { height: 4px; border-radius: 2px; background: #313244; }
|
||||
.iwb-editor-adj-range::-moz-range-thumb {
|
||||
width: 11px; height: 11px; border-radius: 50%; background: #e8a735; border: 1px solid #1e1e2c;
|
||||
}
|
||||
.iwb-editor-adj-range:focus-visible { outline: 2px solid #89b4fa; outline-offset: 2px; }
|
||||
.iwb-editor-adj-val {
|
||||
width: 36px; padding: 1px 2px; text-align: center;
|
||||
background: #26263a; border: 1px solid #3a3a52; border-radius: 4px;
|
||||
color: #cdd6f4; font: 500 10px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
|
||||
font-variant-numeric: tabular-nums;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.iwb-editor-adj-val::-webkit-outer-spin-button,
|
||||
.iwb-editor-adj-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
|
||||
.iwb-editor-adj-val:focus { outline: none; border-color: #89b4fa; }
|
||||
.iwb-editor-adj-row.is-set .iwb-editor-adj-val { color: #f3dcb0; border-color: #4a4433; }
|
||||
.iwb-editor-adj-tip {
|
||||
margin: 0; font-size: 9.5px; line-height: 1.4; color: #6c7390;
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
v1.6:图层面板多选(⌘/Ctrl 点击)+ 合并按钮
|
||||
多选用青色侧条与单选(橙色 #e8a735)区分:一个图层可以「被选中但不在合并集合里」,
|
||||
|
||||
Reference in new issue
Block a user