• Editor
  • Best Export Settings for Scaling Down Spine Animation Without Losing Quality

Question: Hi everyone, I am working on a Spine animation where my artwork is currently double the intended size. For example, my assets are 344x276px, but the actual grid size for the slot game is 172x138px. The game resolution is 1920x1080px.

I want to export my animation at half the size while maintaining high quality—without losing sharpness or detail.

1.What are the best export settings in Spine to achieve this?

2.Is it better to create animations at double size for future flexibility, or should I work in the final resolution from the start?

I appreciate any tips or recommended practices for scaling down animations effectively. Thanks in advance!

  • Misaki đã trả lời bài viết này.
    Related Discussions
    ...

    sshukla We'd be happy to help, but your question didn't seem to indicate whether you wanted to play the skeleton animation you created using the Spine runtime, or export it as a PNG sequence or video and play it in the game. This will change what we advise you to do, so please let us know.

    Sorry for that, I am exporting as a json

    • Misaki đã trả lời bài viết này.

      sshukla I see. First, you should adjust the Resample option in the Texture Packer settings:

      Bicubic is commonly used, but depending on the art style, another algorithm may be more suitable. It's best to test and compare the export results on your end.

      In texture packing, the scale value and resample algorithm are almost the only settings that significantly affect image quality.
      Creating textures at twice the required size is a good practice for future flexibility and generally doesn't cause issues. However, scaling can sometimes result in slight misalignment when overlapping images perfectly.
      For more details, see this thread: https://esotericsoftware.com/forum/d/26863-strange-smudges-on-some-borders-in-unity

      It might be a good idea to do a little testing just to see if this kind of problem occurs. I hope this answer helps you.

      Thanks for the answer,
      If a scale the root bone in .5 scale and export the texture sheet in .5, that can also work, does it coz any blueness or pixilation in art.

      the game will create in pixi js

      • Davide đã trả lời bài viết này.

        sshukla

        The best way to determine the best result for your use case is to experiment with different combinations yourself.

        On the editor side, Misaki has already explained how to scale and change the scaling algorithm.

        On the Pixi side, we configure three properties for each texture: the min filter, the mag filter, and mipmap generation.

        When setting up the texture packer configuration, you can choose the Runtime configurations, where you can define the following settings:

        The available filter options are:

        The following code applies these settings to configure the corresponding values on the Pixi texture:

        private static toPixiMipMap (filter: TextureFilter): boolean {
        	switch (filter) {
        		case TextureFilter.Nearest:
        		case TextureFilter.Linear:
        			return false;
        
        		case TextureFilter.MipMapNearestLinear:
        		case TextureFilter.MipMapNearestNearest:
        		case TextureFilter.MipMapLinearLinear: // TextureFilter.MipMapLinearLinear == TextureFilter.MipMap
        		case TextureFilter.MipMapLinearNearest:
        			return true;
        
        		default:
        			throw new Error(`Unknown texture filter: ${String(filter)}`);
        	}
        }
        
        private static toPixiTextureFilter (filter: TextureFilter): SCALE_MODE {
        	switch (filter) {
        		case TextureFilter.Nearest:
        		case TextureFilter.MipMapNearestLinear:
        		case TextureFilter.MipMapNearestNearest:
        			return 'nearest';
        
        		case TextureFilter.Linear:
        		case TextureFilter.MipMapLinearLinear: // TextureFilter.MipMapLinearLinear == TextureFilter.MipMap
        		case TextureFilter.MipMapLinearNearest:
        			return 'linear';
        
        		default:
        			throw new Error(`Unknown texture filter: ${String(filter)}`);
        	}
        }

        As you can see, Linear and Nearest do not generate mipmaps, whereas all other configurations do. Mipmaps are useful when scaling down textures, as they contain smaller, pre-filtered versions of the texture to reduce aliasing.

        Regarding filters:

        • Nearest is used for Nearest, MipMapNearestLinear, and MipMapNearestNearest.
        • Linear is used for Linear, MipMapLinearLinear, MipMapLinearNearest, and MipMap.

        If your game targets 1080p, you can simply export assets at the desired resolution.
        If your game needs to scale up, you may want to export 2x textures and enable mipmaps.

        To avoid pixelation, choose Linear as the filter.

        Additionally, if you're using Pixi, you can take advantage of Pixi bundles, which allow you to include different textures for different resolutions. In this case, you can export high-resolution textures and create a Pixi bundle with 1x, 2x, and 3x versions of your textures. Read more about this in our documentation.

        You can easily create Pixi bundles using the Pixi Asset Pack.

        • Misaki đã thích điều này.

        When the editor does texture filtering (texure packing or image/video export), which means scaling up, down, or rotating, the quality depends on the editor's smoothing settings. For downscaling it's important to enable Anisotropic filtering.

        When rendering at runtime, if you want downscaling to look the best it can, you should also use anisotropic filtering if you are viewing at oblique angles, otherwise if you're downscaling uniformly then bicubic should suffice. I'm not sure how hard that is to do in Pixi, so it'd be a good plan to ask the Pixi guys.