Opticraft Community

Discussion forum => Helpful articles => Topic started by: matt88222 on May 15, 2011, 02:21:20 am

Title: Using ImageMagick
Post by: matt88222 on May 15, 2011, 02:21:20 am
Requested by toxic:

A short guide on using ImageMagick, an image editing program that works through the command line.
Here I'll show you how to remap images, useful for making sprites with a palette larger than 256 colors.

ImageMagick can be found here: www.imagemagick.org (http://www.imagemagick.org)

Download and install ImageMagick from their website.

First make a folder somewhere and put into it the image you wish to remap and an image containing all the colors you wish to use (the color palette)
Then open up the command prompt, and change directory to this folder you created.

Code: [Select]
cd {directory}
The line used to convert the image takes the following format:

Code: [Select]
convert {image to be converted} -remap {image containing colors (color palette)} {new image to be created}
Then in the folder, the new image will be created.

For changing dithering methods other than the default Riemersma method:

Code: [Select]
convert {image to be converted} -dither {method} -remap {image containing colors (color palette)} {new image to be created}
The methods available for dithering are: none, riemersma, and floydsteinberg

I made a video demonstrating all of this if you'd like to see it done:

http://www.youtube.com/watch?v=dtmGlkeImnc (http://www.youtube.com/watch?v=dtmGlkeImnc)

Hope this helps :)