You switched to D :')
I noticed you have a problem with the rendering function not doing what it should/need 2 slightly different versions of that function. You can try template arguments (like void function(alias const int a)() {...} and func!1 or similar) combined with static if.
I've been meaning to try it out for a while, so figured I'd use this as a test since it's a pretty small project and the old Python script takes like 10 seconds to run. Other than a couple minor complaints, I really like it so far.
There's only one rendering function: generatePreview. generatePreviewVXL/Icemap simply handle file-format specific things, then call generatePreview to actually do the rendering. generatePreviewVXL calls generatePreview with 0,0,0 size to indicate that it should be calculated, and generatePreviewIcemap parses the Icemap file, pulls out the VXL and size data and calls generatePreview with that. computeMapSize is used to parse the map and figure out the dimensions of a block of VXL data, since VXL files have no header and Jagex cocked them up and have different sized maps (with the dimensions stored in some other metadata files somewhere else, no doubt).
Sorry if I misunderstood, but that's how it works.
Yeah, I agree that D is unpolished and slightly unfinished, but it's all mainly details and you clearly see in which direction it goes. It's under heavy development at the moment.
About the problem,
Figure out way to use ImageRGB8 instead of ImageRGBA8 if backgroundColour.a == 255 (waste of space in files) [...]
Can we create two versions of this function from some sort of template?
basically you can pass some compile-time variable, then check for it via static if inside your function. E.g., somewhere in your program you do the alpha channel check, then call either generatePreview!(true)(...) or generatePreview!(false)(...) correspondingly, and you declare it like SuperImage generatePreview(alias UseAlphaChannel)(...)