Saving uncompressed TGA


(this image has nothing to do with this post. Just something I’m working on)

Alas RLE compression isn’t supported everywhere. Can’t expect the earth, it’s only old enough that I can’t find when it was invented. But onto the problem.

I needed to dump out uncompressed tga’s from processing. Turns out this was an old processing feature that was upgraded to RLE. Because I’m still living in the dark ages, Toxi pointed me towards the original code that he wrote for uncompressed tga saving. Just so I don’t lose it and maybe other people are looking for something like this. Here is the slapped together bit of code.

The zipped up sketch

MattD

Processing and tga’s

You can always depend on a tga. That faithful image format is like an old friend. But processing has a bug where is saves them out upside down. You can see the bug in this code
[cce lang="java"]
line(10,10,90,90);
save(“data/img.tga”);
PImage img = loadImage(“img.tga”);
img.save(“data/img2.tga”);
exit();
[/cce]
Until a fix gets in, here is a workaround
[cce lang="java"]
line(10,10,90,90);
save(“data/img.tga”);
PImage img = loadImage(“img.tga”);
PImage outImg = createImage(img.width, img.height, ARGB);
for(int x = 0; x < …. waitaminute
[/cce]
UPDATE:

It’s fixed for 0136. WooT