We all know that unity required every images should be divisible by 4, we all know that sprites width and height should in in divisible by 4, for example sprites should be 412 x 256, each height and width is divisible, so unity will apply sprite compression method and your sprite reduce its size That overall impact on reduce build size,
Artist just export the png assets without verifying the height and width dimension, some time the weird resolutions are imported into unity and unity will not to compress your sprites, so overall those affected sprites may increase your game size and overall performance
With the help of our team and some great AI tool we are finding an optimized way to reduce time for artists to calculate pixels during individual png exporting..
What previous process are we are doing at that time of exporting the the pngs from photoshop is, we are duplicating each layer to new file and trim them out than we are calculate the height and width pixel if the image have canvas size after trim is 315 x 330 we are manually adjust the height and width by new pixels that can be divisible by 4 has to be 316 x 332 and than we apply save as png to export folder
So due to this time consuming process we build an python tool that can be turn multiple of images to fix those resolution issues
This python script can be helpful for us to deliver fast processes for exporting png,so now we just save as png whatever resolutions they have and apply this script to multiple files to fix all those resolutions in just 1 click.
The same way a developer can implement this script if the artist has sent false or wrong dimension png, the developer can easily fix it without disturbing the artist to change its canvas that can be optimized for unity.
Our big impact once we implemented this script and scan the whole project and our big milestones are we reduce the Android Apk size 15mb since we have lot of pngs on our project, while we previous build size around 134 mb and after this fixing the al pngs we are reduce the size by 119 mb,
Here are the steps to install python script and access it through windows right click menu by adding this script to windows registry
Note : This method has be limited to Windows only, we will release new blog and script and methods for MacOs later
Step 1: Install Python
Make sure you have added this python to the environment variable path to access it through cmd.
Step 2: Open cmd and check python is installed or not paste this and check
Python –version
>>python -version
Step 3: Open CMD and install png manipulation package for python
Pip install pillow

Leave a Reply