Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EMT] Icon with resolution set in win format has been scaled and cannot be converted to krkr format #75

Closed
lightlesSo opened this issue Mar 27, 2022 · 7 comments
Assignees

Comments

@lightlesSo
Copy link

lightlesSo commented Mar 27, 2022

The emote for krkr doesn't support resolution. But the result of psbuild -p krkr has resolution property.

 "source": {
    "tex": {
      "icon": {
        "0000": {
          "attr": 1,
          "height": 91,
          "left": 3973,
          "metadata": {
            "zorder": 29
          `},`
          "originX": 40,
          "originY": 45,
        "resolution": 0.9,
          "top": 303,
          "width": 81
        },
        "0001": {`

If a psb file has resolution property . There will be a wrong picture.
I think it can be solved like this :
Enlarge the picture 1/resolution multiples. Set left=left/resolution top=top/resolution.

      "texture": {
        "ast": 0,
        "height": 4096,
        "pixel": "#resource#0",
        "type": "RGBA8",
        "width": 4096
      },

Set height=height/resolution ,width=width/resolution.
Remove resolution property.

All resolutions need to be equal to others.

@UlyssesWu
Copy link
Owner

UlyssesWu commented Mar 28, 2022

Thanks for the info, but where are samples?
PR is also welcomed if you're not willing to provide PSB files.

@UlyssesWu
Copy link
Owner

UlyssesWu commented Mar 28, 2022

Enlarge the picture 1/resolution multiples

That's probably not a good idea because the scale-up will most likely ruin the image quality unless we use something like waifu-2x, but that will be unstable for some users without a good CPU/GPU. Maybe I will just remove "resolution" for krkr (if nothing wrong).

@UlyssesWu
Copy link
Owner

我使用EMT编辑器进行测试,对同一个设置了resolution的模型导出KRKR和WIN格式的PSB,结果证明KRKR模型支持resolution,你的说法似乎不成立,因此won't fix。

初步看来,resolution只是关系到该图片显示的清晰度,并不影响尺寸。
image

WIN:

        "0197": {
          "attr": 0,
          "height": 126,
          "left": 2693,
          "metadata": null,
          "originX": 95,
          "originY": 63,
          "resolution": 0.25,
          "top": 722,
          "width": 191
        },

KRKR:

      "icon": {
        "ex_body_a": {
          "clip": {
            "bottom": 0.956521749,
            "left": 0.0430622026,
            "right": 0.9569378,
            "top": 0.04347826
          },
          "compress": "RL",
          "height": 126,
          "metadata": null,
          "originX": 95,
          "originY": 63,
          "pixel": "#resource#145",
          "resolution": 0.25,
          "width": 191
        }
      },

@UlyssesWu
Copy link
Owner

如果你有问题可以继续在此回复。

@UlyssesWu UlyssesWu reopened this Apr 3, 2022
@UlyssesWu
Copy link
Owner

懂了,影响的是WIN格式texture中的尺寸。那么只能去掉resolution了

@UlyssesWu UlyssesWu removed the invalid label Apr 3, 2022
@UlyssesWu UlyssesWu reopened this Apr 3, 2022
@UlyssesWu UlyssesWu changed the title The emote for krkr doesn't support resolution property now. [EMT] Icon with resolution set in win format has been scaled and cannot be converted to krkr format Apr 3, 2022
@UlyssesWu UlyssesWu self-assigned this Apr 3, 2022
@UlyssesWu UlyssesWu added the bug label Apr 3, 2022
@lightlesSo
Copy link
Author

lightlesSo commented Apr 18, 2022

抱歉 之前忙着做些事 忘了这里 现在还需要提供有错误的文件吗
win格式是否错误不知道,krkr和win格式在用FreeMoteViewer预览时都是正确的
assetbundle里的文件拆开是这样的图片
2003031400_01_mid_tex000

按照krkr格式输出 其中的一部分是这样的

tex-0051

在krkr里会有这样的结果

offset

把图片放大后去掉resolution等价于把图片切成这样再放大 然后在krkr里才会正常显示

tex-0052

你现在用的是哪种方法呢
1.放大后再去掉resolution之后正常处理 这种情况需要所有的resolution相等

2先把icon的width和height乘resolution ,分割成小图后再对每个小图放大1/resolution的倍数 这时每个resolution可以不相等,不知道是否有这种情况

测试文件
https://mega.nz/file/Rw8RiQrb#M0YPWmIg2E_5WLwhhQ759PN9eu6U5Ne4HX5AB0SNq2M

@UlyssesWu
Copy link
Owner

反馈太慢了,一般7天无反馈我就认为你把我鸽了。现在请你自己尝试新的release。
另外,提供样本,首先得提供原始的PSB文件,不能只提供FreeMote的产物。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants