更新记录

1.0.21(2026-11-30)

  • 修复蒸汽模式的 bug
  • 修复 Android 贴图选择图片没有反应

1.0.20(2026-11-25)

  • 修复蒸汽模式的 bug
  • Android 贴图改为系统照片选择器,不申请 READ_MEDIA_IMAGES、READ_MEDIA_VIDEO

1.0.19(2026-11-07)

  • 选色改为上面色板、下面色相条,色相条决定上面的颜色
  • 色板和色相条上的圆点都停在区域内
  • 确认后的颜色会显示在外面的色点里
查看更多

平台兼容性

uni-app(4.27)

Vue2 Vue3 Chrome Safari app-vue app-vue插件版本 app-nvue Android Android插件版本 iOS iOS插件版本 鸿蒙
× × × × √ 1.0.14 × 5.0 1.0.14 13 1.0.14 -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
× × × × × × × × × × × ×

uni-app x(4.27)

Chrome Safari Android Android插件版本 iOS iOS插件版本 鸿蒙 微信小程序 支付宝小程序
× × 5.0 1.0.15 13 1.0.15 × × -

其他

多语言 暗黑模式 宽屏模式 蒸汽模式
√ × × ×

图片编辑(fz-app-image-editor)

App 原生图片编辑:裁剪、旋转、翻转、消除、马赛克、涂鸦、文字、贴图、调色。支持 uni-app x。

将插件放入 uni_modules,制作自定义基座或正式打包。修改原生代码后需重新打包。

用法

import { editImage } from '@/uni_modules/fz-app-image-editor'

const res = await editImage({
    imagePath: filePath,
    locale: 'zh',
    themeColor: '#2F6FED',
    canvasColor: '#FFFFFF',
    brushColor: '#17233D',
    textColor: '#EF4444',
    healColor: '#FF685E',
    filter: 'warm',
    filters: [
        { id: 'normal', label: '原图' },
        { id: 'film', label: '胶片', brightness: 5, temperature: 18, colorFilter: [245, 209, 160, 0.2] }
    ],
    style: { panelColor: '#FFFFFF', brushSize: 28, textSize: 48 },
    strings: { defaultText: 'Pet' },
    icons: { close: '/static/close.png' },
    features: { sticker: false }
})
// res.path 本地 jpeg

保存返回本地 JPEG 路径。用户取消返回 94204;非 App 调用返回 94208。

可配置项

未传字段使用默认值。

字段 默认 说明
imagePath 必填 本地图。相册、_doc、file://
maxEdge 2048 导入时长边上限。<= 0 也按 2048
locale 系统语言 en / zh / es,也认 zh-CN、en-US
filter 第一条 打开调色时选中的滤镜 id。找不到就用第一条
filters 内置 7 条 非空则整条替换内置滤镜
themeColor #48A16B 保存、应用、选中滤镜、裁剪描边
canvasColor #FFFFFF 图片周围的底色,不写进图片
brushColor #48A16B 涂鸦默认色,不跟主题色走
textColor #EF4444 文字默认色
healColor #B4FF685E 消除笔涂抹色。只写 #RRGGBB 时透明度用 180
colors 内置 5 个 涂鸦、文字下固定露出的颜色。最多 8 个
palette 内置 12 个 色轮里「最近使用」的初始颜色。最多 12 个

style 未传项使用默认值。超出范围会夹到区间内。

字段 默认 范围 说明
inkColor #17233D 颜色 主文字
mutedColor #657180 颜色 提示、滑块标签和数值
fillColor #F6F8FA 颜色 按钮和输入框底色
trackColor #E6EBEF 颜色 滑块轨道
panelColor #FFFFFF 颜色 底栏和弹层
lineColor #E8EAEC 颜色 色块描边、输入框边线
brushSize 28 6–100 涂鸦、消除、马赛克的初始笔刷
textSize 48 16–220 文字初始字号,按屏幕点
stickerSize 28 8–160 贴图初始大小

features 不传或 null 为开,false 才隐藏。

字段 默认 说明
adjust true 调色
crop true 裁剪
heal true 消除
mosaic true 马赛克
draw true 涂鸦
text true 文字
sticker true 贴图
saveAlbum true 左下角保存到相册

icons 按键替换本地图。没传的键用内置图标。除 close 外建议单色透明 PNG,界面会染色。close 按原图显示。

键 位置
undo redo reset 撤销、重做、还原
adjust crop heal mosaic draw text sticker 工具栏
close 左上角关闭

滤镜字段都是数字,不传为 0(叠色除外)。colorFilter 为 [r, g, b, a],有它就覆盖 filterR / filterG / filterB / filterA;缺 a 时 a 为 1。r/g/b 为 0–255,a 为 0–1。

字段 含义
id 必填。filter 用这个值选中
label 按钮文字。空则用 id,也能用 strings 按 id 覆盖
brightness 亮度
contrast 对比
saturation 饱和
blackPoint 黑场
whitePoint 白场
shadows 阴影
highlights 高光
gamma 伽马
temperature 色温
tint 色调
vibrance 自然饱和
brilliance 鲜明度
definition 清晰度。负值变柔,正值变锐
filterR filterG filterB filterA 叠色

界面上只有亮度 -60~60、对比 -60~60、饱和 -100~100 三根滑杆。其余字段只来自预设。

内置滤镜:normal 原图、vintage 复古、bw 黑白、vivid 鲜明、soft 柔和、warm 暖调、cool 冷调。

strings 只传要改的键。下面是中文和英文默认词。西语键相同,内置为西班牙语。

键 中文 English
cancel 取消 Cancel
undo 撤销 Undo
redo 重做 Redo
reset 还原 Reset
save 保存 Save
apply 应用 Apply
adjust 调色 Adjust
crop 裁剪 Crop
heal 消除 Heal
mosaic 马赛克 Mosaic
draw 涂鸦 Draw
text 文字 Text
sticker 贴图 Sticker
free 自由 Free
ratio 比例 Ratio
confirm 确定 Confirm
close 关闭 Close
flip 翻转 Flip
rotateFmt 旋转 {n}° Rotate {n}°
brush 笔刷 Brush
color 颜色 Color
recent 最近使用 Recent
add 添加 Add
delete 删除 Delete
choose 选择 Choose
size 大小 Size
normal 原图 Normal
vintage 复古 Vintage
bw 黑白 B&W
vivid 鲜明 Vivid
soft 柔和 Soft
warm 暖调 Warm
cool 冷调 Cool
brightness 亮度 Brightness
contrast 对比 Contrast
saturation 饱和 Saturation
ok 确定 OK
done 完成 Done
addText 添加文字 Add text
editText 编辑文字 Edit text
defaultText 你好 Hello
hintIdle 选一个工具,完成后保存。 Pick a tool, then save when you’re done.
hintCrop 拖动选框,双指缩放。 Drag the box. Pinch to zoom.
hintHeal 涂抹要去掉的位置,然后点应用。 Paint the spot to remove, then Apply.
hintMosaic 涂抹要打马赛克的区域,然后点应用。 Paint the area to mosaic, then Apply.
hintDraw 在照片上涂鸦,然后点应用。 Draw on the photo, then Apply.
hintAdjust 选滤镜或拖动滑杆,然后点应用。 Pick a filter or drag sliders, then Apply.
hintText 添加文字。拖动移动,捏合或拖角缩放。 Add text. Drag to move, pinch or use the corner to resize.
hintSticker 从相册选一张贴图。拖动移动,捏合缩放。 Choose a sticker from photos. Drag to move, pinch to resize.
addTextFirst 请先添加文字 Add text first
chooseStickerFirst 请先选择贴图 Choose a sticker first
applyOrCancel 请先应用或取消当前工具 Apply or cancel the current tool first
paintFirst 请先涂抹要消除的区域 Paint the area to remove first
noLibrary 无法打开相册 Photo library is not available
layerMax 最多 8 层 Up to 8 layers
openFail 无法打开图片 Could not open image
saveFail 保存失败 Save failed
savedAlbum 已保存到相册 Saved to album
stickerFail 无法加载贴图 Could not load sticker
healFail 消除失败 Heal failed
restoreTitle 还原原图? Restore original?
restoreBody 还原为原图?所有编辑都会丢弃。 Restore the original photo? All edits will be discarded.

错误码

码 含义
94201 路径无效
94202 读写失败
94203 无法解码
94204 用户取消
94205 没有前台页面
94206 编辑器已打开
94207 消除笔涂满整图
94208 非 App

App 配置

本插件不申请 READ_MEDIA_IMAGES、READ_MEDIA_VIDEO。Android 13 及以上贴图用系统照片选择器,更低版本用系统文件选择器。保存到相册只写入编辑结果。宿主自己用 uni.chooseImage 选图时才需要 Gallery,那不属于本插件。iOS 贴图仍会申请相册权限。

相关插件

查看全部 FZ 插件

隐私、权限声明

1. 本插件需要申请的系统权限列表:

不申请 READ_MEDIA_IMAGES、READ_MEDIA_VIDEO。Android 贴图用系统照片选择器。保存到相册只写入本插件生成的图片。

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

图片仅在本机处理,不上传服务器

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

无