函数:ts.img.binaryzationImg 图片二值化(仅支持 iOS)

函数名称:图片二值化

函数功能:将指定图片进行二值化处理

函数方法

ts.img.binaryzationImg(imgPath,value)

参数 类型 必填 说明
imgPath string 图片路径
value number 偏色值

函数用例

local ts = require("ts")
snapshot("test_3.jpg", 101, 101, 200, 200)
ts.img.binaryzationImg(userPath().."/res/test_3.jpg",100)--不支持相对路径
dialog("输出图片保存在"..userPath().."/res/tmp.jpg")

注意事项

  • 图片保存路径:

    iOS 资源路径:/var/mobile/Media/TouchSprite/res/(更多 - 文件管理 -资源)

    安卓资源路径:/mnt/sdcard/TouchSprite/res/(我的账号 - 文件管理 -资源)

Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""