Writing · 2018 · 1 min
Image Magick Tricks
Image Magick is a command line tool for manipulating images. It let’s you do so many cool things to images but for the purpose of game dev, I use it to quickly clean up images. It’s a shame it’s not more widely used.
Reasons it’s awesome:
- It’s free.
- On all operating systems.
- Can batch commands.
- Commands can be easily saved and reused.
Install image magick on OSX with:
Chop Extra Pixels
I use Animate CC for my art and it usually adds unnecessary whitespace around the image – expecially if a shadow filter is present. In the case of custom cursors, I can’t have that around the tip of the cursor.
So in one command I can clean up all the cursors.
Note: mogrify will overwrite the source image. If testing use convert.
Top left space is gone.
Resize Image To Power Of 2
On Windows, hardware cursors need to be sized 32x32, or else the image gets stretched – which you don’t want. I use image magick to resize it.
Cursor is exactly 32x32
Create Shader Channeled Images
A good technique in shader dev is to combine your black and white images – up to 4 – into one by putting each image into it’s own channel on the single image.
This can easily be done in image magick without having to even bootup Photoshop.
Conclusion
That’s all. All these commands are saved somewhere in my project, so they can be ran whenever I need to regenerate the images. This makes development so much easier.
Comments
No comments yet. Be the first.