• Editor
  • Reducing export file size...

Related Discussions
...

Hi everyone,

I am wondering is there a way to reduce an exported file size. For instance if I Export > Data > Json and set it to export as a .png is there a way to make this exported .png file size smaller in way of compression without actually reducing the output size.

Any feedback is much appreciated.

PNG is already using the DEFLATE algorithm (same that ZIP uses). You can use tools like pngout or pngcrush which try to find better compression, but make sure to test that your game toolkit can still open the resulting PNG files. You can reduce the bit depth from 24 bits to 8 (eg with Photoshop or opt-png in littleutils), but this will reduce the colors to 256 (like GIF). Other than that, PNG is already a compressed format and further compression won't help much. You can scale the texture atlas down and possibly endure a quality loss at runtime. Otherwise, using smaller images or images with less details will result in smaller PNGs.

You can more easily reduce the export data size. First step is to use a binary export. Second step is to compress the binary export (deflate, lzma, lzo, etc). After that, see the user guide for optimization.
Metrics - Spine User Guide: Performance

Thankyou for the replys it is much appreciated,

As an example if I imported images at a scale of 500 x 500 into spine and then upon export wanted the exported scale to be 250 x 250 at what stage would I alter the scale for a .png json export,

in the SETUP view via the root bone (scale)
in the ANIMATE view via the root bone (scale)
or in the atlas setting Output > Scale box

Thanks again.

You could scale your project, but there is no reason to. You can have your project at one size and use smaller or larger size images/atlas at runtime. I suggest using the scale in the texture packer settings, then specify that same scale when loading the JSON data:
Loading Skeleton Data - Spine Runtimes Guide: Scaling

Nate wrote

You could scale your project, but there is no reason to. You can have your project at one size and use smaller or larger size images/atlas at runtime. I suggest using the scale in the texture packer settings, then specify that same scale when loading the JSON data:
Loading Skeleton Data - Spine Runtimes Guide: Scaling

Thanks again for the reply,

How would I go about scaling my project the other way? it seems even when I scale the root the .json export ends up the default scale anyway?

Scale on the root bone will be reflected in the JSON by the root bone having eg scaleX: 0.5, scaleY: 0.5. It doesn't change all the numbers. You could do the same at runtime by grabbing the root bone and setting scaleX and scaleY. Doing that isn't helpful though if you key the root bone scale in animations.

You can export to JSON, then import back into a project and specify a scale:
Import - Spine User Guide: Scale
This will scale all the numbers in your project (bone locations, etc). This can be useful if you want to change the size of all the images that your Spine project uses. Be careful about changing your image sizes with your project open, Spine will notice and you may not like the behavior regarding meshes:
Meshes - Spine User Guide: Image resize
We have plans to improve that:
https://waffle.io/EsotericSoftware/spine/cards/5947aa1a73088000e2c7c0ec