Related Discussions
...

Hello, I would like to find animator who was already solving optimizing (structure/file size/files amount) spine files and exports. Our project is browser-based, so no installation.

Hello, what version of Spine and runtime are you using?

My optimization recommendations are:

  • Switch to polygonal packing and if you're on 4.1, try webp export in the texture packing settings.
  • Use skel instead of json: it's smaller and faster.
  • Get rid of direct deformation keys.
  • Prune your weights.
  • Remove the vertices that have the exact same weights in a large area.
  • Deactivate non visible attachments if a clipping is active.
  • Clean up extra keys on export.

More can be found here: Metrics view - Spine User Guide: Performance

I am not animator, I am looking for one who would do these tasks. Thanks for recommendations anyway, I will forward it to someone interested :-)

Erika a écrit

Hello, what version of Spine and runtime are you using?

My optimization recommendations are:

  • Switch to polygonal packing and if you're on 4.1, try webp export in the texture packing settings.
  • Use skel instead of json: it's smaller and faster.
  • Get rid of direct deformation keys.
  • Prune your weights.
  • Remove the vertices that have the exact same weights in a large area.
  • Deactivate non visible attachments if a clipping is active.
  • Clean up extra keys on export.

More can be found here: Metrics view - Spine User Guide: Performance

Hi Erika,

Jan has different issue than you are thinking.

Primarily in spine characters are in decreased size, because it starts to be quite large. he can optimize png from export, but when imported to game, it has color issues.

So, need your help to solve this issue.

Without knowing the runtime you are using, I can only generically advise checking color management in your game engine.
In spine the setting can be found here: Settings - Spine User Guide: Color management
Unless the problem is something else, but without being able to see how they differ it's hard to tell.

You can also resize the characters in Spine like this:
Fitting new high-res assets with a smaller skeleton?

Rajesh a écrit

Primarily in spine characters are in decreased size, because it starts to be quite large. he can optimize png from export, but when imported to game, it has color issues.

Please always try to describe any issues you are having as detailed as possible, and share screenshots that show the problem you are facing if it's a visual issue.

Unfortunately we can only guess what you mean by "Primarily in spine characters are in decreased size" and by "it has color issues". My guess of "color issues" is that you actually mean that you see compression artifacts from using a lossy-compression file format. Depending on which runtime or game engine you are using, using lossy input image formats like jpeg for example would make no sense (e.g. in Unity, since the jpeg file only exists in your project, not the built binaries or packages). So to be able to help, I'm afraid we need more information.

6 jours plus tard

Project works on Unity using newest Spine. It's browser-based, so no installation. Primary concern right now is size of exports = higher bandwidth.

I tried to compress PNG images from export to get them to better file size, but when imported it looks like this:

It creates green color.

Do you mean that you import the compressed PNG files in the Unity Editor, and that you see the above green colorin transparent areas in your scene? If so, then perhaps you have exported your atlas images as Premultiply alpha (PMA), but your PNG compression tool does not respect PMA at all. Another guess might be that the PNG files are not written with proper alpha channel information. Without having the problematic files at hand, we can't really tell.

Apart from that, if you do not directly download PNG files to your game but first import them in Unity and then create asset bundles or addressables or somthing like that, then Unity will take care of any compression and your initial PNG file compression is only used by the Unity Editor (so it's not used in your game), as I mentioned in the posting above.

Harald a écrit

Do you mean that you import the compressed PNG files in the Unity Editor, and that you see the above green colorin transparent areas in your scene?

Yes, exactly. Regular Spine export, then compress PNG via online tool, and import to Unity. Developers told me they had to adjust alpha to remove green color, but then there appears some pixel errors in the animation image.

Any hints of proper compress tool you guys using? Maybe also different Spine export setup to get the smallest size possible without loosing image quality? Thank you!

Who knows what an online tool will do to the PNGs. If you are using color bleed, pixel color data is stored in pixels that have 0 alpha. Probably an online tool will remove this color data, messing up the bleed. This isn't a problem using PMA.

Spine can optimize PNGs, but currently only for PNG export, not texture packing. I suggest using OxiPNG, not an online tool. OxiPNG is very fast, does a good job, and shouldn't wreck your PNGs.

un mois plus tard

Hello guys. I tried OxiPNG, but decrease in size was like 1 %. I was optimizing files saved in Photoshop. When I try some online tool, it lowers size by 30-70 %. I will try to investigate more. May be useful for others as well.

OxiPNG is lossless. Other tools are likely removing information. They could be reducing quality, for example by changing to a palette instead of a full color image or by re-encoding the image so it compresses better.

Note if you are using Bleed when texture packing, removing the color information from transparent pixels will make a smaller PNG, but the bleed effect will be gone and you may get artifacts when scaling the images. This is not an issue if using PMA.

Thanks Nate for information. AI adviced me to just "Export as" in Photoshop and set PNG as 8 bit. I can't notice a difference and it did good job in lowering file size. I will try to do the same with exported images from Spine and write here feedback.

I also read somewhere that in Spine you can compress PNG as APNG or MNG.

An 8-bit PNG uses a palette instead of full color. You can use Spine 4.1+ to create 8-bit PNGs by checking Reduce colors in the PNG export dialog. This is likely higher quality than what conversion tools will give you.

APNG and MNG is a sequence of PNGs, so they are not any more compressed than PNG. MNG is seldom used.