How to convert Images to C-Source code in Batch

The demo will show you how to convert all images of a certain type in a directory to c-souce code in batch.

The conversion can be made from .BMP, .JPG, and .PNG images to many different color modes:

  • 24 bit per pixel RGB for highest quality
  • 16 bit per pixel RGB
  • 8 bit per pixel RGB with and without dither
  • 4 bit per pixel RGB with and without dither
  • 8 bit per pixel GRAY
  • 4 bit per pixel GRAY with and without dither
  • 2 bit per pixel GRAY with and without dither
  • 1 bit per pixel B&W with and without dither

The conversion parameter is :ZXx, see the text above the woodpecker:

How to convert images in batch



How to make the conversion from the commandline

Start IconEdit:

C:\IconEdit\IconEdit.exe

Point to a directory:

C:\IconEdit\IconEdit.exe C:\images\*.png

Specify batch conversion with :B and the type, here .PNG png:

C:\IconEdit\IconEdit.exe C:\images\*.png :Bpng

Specify batch output color type with :Z and the type, here 8 bit per pixel RGB with dither Bd:

C:\IconEdit\IconEdit.exe C:\images\*.png :Bpng :ZBd

This generates a group of c-source images in the same directory, and with the same names, just Name.c instead of Name.png.



HowTo demo button How to make C-source code fonts home.

IconEdit font and symbol editor home IconEdit font and symbol editor home