Archive for the ‘Misc.’ Category

2009-11-09

Tool: Binary data to embeddable char array

Sometimes there’s a need to embed some little bit of binary data in the executable. The reasons may vary – perhaps it is for a resource you want to exist even if data files are missing, or it could be even something you want to “hide” from some curious wannabe-hackers.

In the past years my typical use case was as follows. I used to make “64 KB intros” (such as this one), and for those I needed to embed a few data files to the executable as object data, so that I could exploit compression of the executable packer without writing a proper compression tool myself (such as UPX).

(more…)

2009-10-17

Tool: pngprep

When programming visuals, I often need to fix color values of pixels in image data where alpha is 0. Here’s a little tool called pngprep which can do some pre-processing of image data and save the result as a 32 bpp png file.
(more…)

2009-10-16

Tool update: psdslayer 1.1

A while ago I posted psdlayerstga 1.0. I have now updated it to support saving to PNG files, which is also now the default output format. The tool also got renamed to psdslayer, since I was constantly imagining, and even mistyping, the name to be “psd slayer” rather than “psd layers“. And I find it funny.
(more…)

2009-09-09

Tool: psdlayerstga

UPDATE: psdlayerstga has been renamed to psdslayer with addition of saving the layers as png files. Get the new tool from here.

I took DrPetter’s PSDImage code for extracting layers from PSD images, and combined it with stb_image just for saving out the layers easily as TGA files. And then I included some simple options and output of the metadata (i.e. name and position of each layer). Result is a little command-line utility, “psdlayerstga”. Use it for anything, but do so at your own risk. (The PSDImage code uses that same license, and stb_image is public domain.)

Download here, including C/C++ source and a pre-built executable for windows:
psdlayerstga.zip
Go get newer version (psdslayer) from here.

Edit: Don’t miss psdparse below (suggested by Toby), an alternative tool for the same task.