优化部分图像生成的格式及尺寸,获得速度与质量的平衡

This commit is contained in:
yoimiya-kokomi 2022-04-28 02:49:24 +08:00
parent 3ecde0ef77
commit 7c7e3d6033
5 changed files with 11 additions and 11 deletions

View File

@ -94,8 +94,8 @@ export async function sysCfg(e, { render }) {
let base64 = await render("admin", "index", { let base64 = await render("admin", "index", {
...cfg, ...cfg,
cfgScale: Cfg.scale(1.2) cfgScale: Cfg.scale(1.4)
}, "png"); });
if (base64) { if (base64) {
e.reply(segment.image(`base64://${base64}`)); e.reply(segment.image(`base64://${base64}`));
} }

View File

@ -345,8 +345,8 @@ async function renderCard(e, avatar, render, renderType = "card") {
bg, bg,
...getCharacterData(avatar), ...getCharacterData(avatar),
ds: char.getData("name,id,title,desc"), ds: char.getData("name,id,title,desc"),
cfgScale: Cfg.scale(1.25) cfgScale: Cfg.scale(1.6)
}, "png"); });
if (base64) { if (base64) {
e.reply(segment.image(`base64://${base64}`)); e.reply(segment.image(`base64://${base64}`));
} }

View File

@ -41,8 +41,8 @@ export async function help(e, { render }) {
let base64 = await render("help", "index", { let base64 = await render("help", "index", {
helpCfg: helpGroup, helpCfg: helpGroup,
cfgScale: Cfg.scale(1.05) cfgScale: Cfg.scale(1.2)
}, "png"); });
if (base64) { if (base64) {
e.reply(segment.image(`base64://${base64}`)); e.reply(segment.image(`base64://${base64}`));
} }

View File

@ -78,8 +78,8 @@ export async function consStat(e, { render }) {
pct: function (num) { pct: function (num) {
return (num * 100).toFixed(2); return (num * 100).toFixed(2);
}, },
cfgScale: Cfg.scale(1.4) cfgScale: Cfg.scale(1.5)
}, "png"); });
if (base64) { if (base64) {
e.reply(segment.image(`base64://${base64}`)); e.reply(segment.image(`base64://${base64}`));
} }
@ -156,8 +156,8 @@ export async function abyssPct(e, { render }) {
pct: function (num) { pct: function (num) {
return (num * 100).toFixed(2); return (num * 100).toFixed(2);
}, },
cfgScale: Cfg.scale(1.4) cfgScale: Cfg.scale(1.5)
}, "png"); });
if (base64) { if (base64) {
e.reply(segment.image(`base64://${base64}`)); e.reply(segment.image(`base64://${base64}`));
} }

View File

@ -393,7 +393,7 @@ let Calc = {
avg: atkNum * pctNum * (1 + multiNum) * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum avg: atkNum * pctNum * (1 + multiNum) * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
} }
console.log(attr, { atkNum, pctNum, multiNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum, kNum }, ret) // console.log(attr, { atkNum, pctNum, multiNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum, kNum }, ret)
return ret; return ret;
}; };