# Texture Management in Defold

**URL:** <https://forum.defold.com/t/texture-management-in-defold/8921>\
**Category:** The Defoldmine\
**Created:** [June 3, 2017, 3:36pm UTC](https://forum.defold.com/t/texture-management-in-defold/8921 "2017-06-03T15:36:22Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![Jerakin](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jerakin/32/3997_2.png) [@Jerakin](https://forum.defold.com/u/Jerakin)\
**Post date:** [March 14, 2019, 10:13am UTC](https://forum.defold.com/t/texture-management-in-defold/8921/17 "2019-03-14T10:13:42Z")

</div>

# Resize images

This post is a response to the post [Scale factor in Atlas settings - #8 by dasannikov](https://forum.defold.com/t/scale-factor-in-atlas-settings/45898/8). I often see images that are too big - here are some of my workflows to resize the images.

* * *

### Macs Automator

Mac has a powerful and under utilized tool called [Automator](https://support.apple.com/guide/automator/welcome/mac). We can set that up to give us a quick context command to scale images in the finder.

> **Automator setup**
>
> Start the Automator and you will be greeted by a view to chose your type. We want a service, as that will be added to the context menu. Select it and pick Choose.
> 
> ![48](https://forum-defold-uploads.b-cdn.net/original/2X/9/9057b950db257fedbf324d42c19bc035c3b2ba8e.png)
> 
> You will then see a empty view where we will build our workflow. In the `Service receives selected [] in []` pick “image files” and “Finder” respectively.
> 
> ![58](https://forum-defold-uploads.b-cdn.net/original/2X/f/f95586a40380a8c28dfe9783c2c9dc35ed704efc.png)
> 
> Search for “scale”
> 
> ![40](https://forum-defold-uploads.b-cdn.net/original/2X/6/6feab7110287e7a1e3bc85f8968274e7953839e7.png)
> 
> Drag “Scale Image” into the workflow, switch to “By Percentage” and set a value you want, in my case I want to be able to scale down the images by 10% so say “Scale the image to 90%”. Then simply save it by doing “File” → “Save”.
> 
> ![41](https://forum-defold-uploads.b-cdn.net/original/2X/f/f35890b837ea5dba1818a0e7fa7da76cbbca22b2.png)
> 
> I named mine “Scale down 10%”, you can now right click on a image and find the resize option under “Services”
> 
> ![11](https://forum-defold-uploads.b-cdn.net/original/2X/9/99fedd450d2f5d9aeb465ab04a8cf50630e85d78.png)

### Resize all images in an atlas

I have a script that I use myself if I decide I want to resize all images in an atlas by a certain percentage. It have a couple of dependencies - DefTree to parse the Defold files (atlas) and Pillow to resize the image.  
`pip install deftree` and `pip install Pillow`

> <https://gist.github.com/Jerakin/cf0e1c4ba8eed98a2f9ffd2797a8e837>

Usage: `python resize_atlas.py --root "path/to/project" --atlas "path/to/project/atlases/game.atlas" -p 10`

### Using Image Magick

If I want to resize a folder of images I would use [ImageMagicks](https://www.imagemagick.org/) mogrify command. Simply open a terminal/command line window and `cd` to the texture folder and then run.  
`mogrify -resize 90% *.png`

### Using 3d party applications on Windows

Windows doesn’t have Automator so to add a right click resize option we can use something like [Image Resizer](https://github.com/bricelam/ImageResizer).

The standard image viewer in any OS always leaves a bit to be desired, on Windows I have used [Irfanview](https://www.irfanview.com/) for years and you are able to [resize images](https://www.bleepingcomputer.com/forums/t/65221/resizing-an-image-using-irfanview/) directly in that. Though, because I already have a lot of other ways to do this (mainly mogrify), I have never used it myself.

---

_[View the full topic](https://forum.defold.com/t/texture-management-in-defold/8921)._
