[tool] Sprite Sheet Generator Current:0900 (64bit support!)

Freeform discussion about anything related to modding Transcendence.
steelwing
Militia Lieutenant
Militia Lieutenant
Posts: 100
Joined: Sun Aug 01, 2010 4:33 pm

Bobby wrote:
steelwing wrote:If that's so, then isn't the process I outlined with gimp perfectly good, once the facings are generated?
It will definitely work, I do something similar with all my ships as well. 1. assemble the images manually in gimp as they are rendered, using snap to grid. 2. copy the background by color, paste onto a new white layer.

Problems can arise if your source images are jpeg, or some other lossy compression, and the background isn't perfectly black, or if you leave on anti-aliasing and keep threshold greater than 0 on the color select tool, the process will leave slightly jagged dark edges which transparency would prevent. Also: I can't seem to get gimp to save in a monochrome bitmap, so I use paint to save the final mask image over itself and cut the file size.
digdug wrote:exactly, what i do is render or make all my graphics in BMP or another lossless format, and only at the end compress it to JPG (at various rates of compression to check the maximum compression you can do without too many jpeg artefacts)
Ah. PNG is supposed to be lossless, so I should be OK using that and then converting everything to JPG. Thankfully, ImageMagick makes that easy...
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

steelwing wrote:
Wolfy wrote:The problem with photoscape is that it does not preserve transparency, which is why I went to the other sprite sheet generator, which had its own problems, which is why I made my own.
Does transparency matter? All graphics for Transcendence (except masks) are done on black backgrounds, anyway.
It does if you want higher quality transparency handling:
George (and generally most modders currently) use 1-bit bitmap, which result in black borders around ship sprites when they pass over a non-black region (or if you trim too close, a harsh anti-aliased edge to the sprite against the backdrop)
By preserving transparency, the alpha channel can be exported to an 8-bit bitmap, allowing for a proper blending of ship and backdrop, without having an unsightly border. This does however use more memory however.
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
steelwing
Militia Lieutenant
Militia Lieutenant
Posts: 100
Joined: Sun Aug 01, 2010 4:33 pm

Wolfy wrote:George (and generally most modders currently) use 1-bit bitmap, which result in black borders around ship sprites when they pass over a non-black region (or if you trim too close, a harsh anti-aliased edge to the sprite against the backdrop)
By preserving transparency, the alpha channel can be exported to an 8-bit bitmap, allowing for a proper blending of ship and backdrop, without having an unsightly border. This does however use more memory however.
Ah. I'll have to see what it looks like in the game to see whether that matters for my mod or not...
User avatar
PKodon
Militia Lieutenant
Militia Lieutenant
Posts: 127
Joined: Sat Apr 18, 2009 6:03 pm
Location: "Minocs. I've got a baaad feeling about this.... This is no cave!"

I've been using IrfanView's panoramic stitching to make my sprite sheets, especially for animated ships.

First I make the vertical strips, then stitch those together horizontally to get the animation frames. You can also use it to convert from one file format to another (png/jpg/bmp/etc.), and to reduce the number of colors to get either a 256-color gray scale mask (which I did for the FalconCV's custom "nozzle" image) or one-bit mask (where you only need to mask off what's not the image).

It also does a good job of resizing, can use filters, do cropping, change the "canvas" size (I used this to move the frames of the "nozzle" image around, a pixel at a time to get them to line up with the ship), even change colors on various things.

It's also great for going through reams of images, as you can either flip through them one by one, or pick them from a browser window that shows them as a grid of thumbnails.
"Don't ask ..., I don't wanna know, and I don't wanna care!" - PK
Meet us on IRC --> Image
"... the hornet battlepod is the closest we have ingame to flying into battle in a wheelbarrow
with a bathtub nailed upside down to the top of it to provide armor."
- The Shrike
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

Ok, I FINALLY got around to remembering to post an updated version of this. 0813 is out with stability improvements, and some other minor changes.

I hope to push out 0820 with a fix for that ever annoying issue of not being able to use images that are taller than they are wide.
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

And its done, 0820 is out. Turns out it was just a single word I needed to change (Width to Height >.<)
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I was just reviewing this thread and I'm stuck on this part by steelwing:
steelwing wrote:To render the facings themselves, I used Blender. Once I had my model worked out and my camera and light positioned, I wrote the script below to render all 40 facings automatically. This uses Blender 2.5 APIs, so don't try it in 2.4x or earlier. Paste it in a text viewer pane and hit alt+p to run.
How am I supposed to get to this part on Blender?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

ask starweaver, he has some blender script to render then turn then render etc :D
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
steelwing
Militia Lieutenant
Militia Lieutenant
Posts: 100
Joined: Sun Aug 01, 2010 4:33 pm

RPC wrote:How am I supposed to get to this part on Blender?
You need a text viewer window in Blender. Paste the code from my post into that, then press alt+p.
Have your model, lights, and camera already positioned, with your model facing "north". The script will then do the render+turn+render thing from there.
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

0.8.5.0 is now up

It has an alphabetic sort feature and runs on a lower framework than before (3.5 instead of 4.0). Also minor perf improvements for large images from threading some stuff.
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

0.9.0.0 is up - Its a 64bit version, so you can make even bigger spritesheets! (Assuming you have the ram to do so)

A large address aware 32bit version will come soon too.

Both branches will be maintained, and there will be a new numbering system to designate which version is for what platform.
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

I thought I would just share my PHP spritesheet stitcher script here:

Code: Select all

<html><head><title>Transcendence Frame Stitcher</title></head><body><pre>
<?php
define('SOURCE_PATH', 'frames');
define('SOURCE_FILENAME_BASE', 'enter_file_name_here'); // expects file names written as: ship0000.png

define('OUTPUT_PATH', '.');
define('OUTPUT_FILENAME', SOURCE_FILENAME_BASE);

$imgSources = array();
if ($dh = opendir(SOURCE_PATH)) {
	while (false !== ($node = readdir($dh))) {
		if (substr($node, 0, strlen(SOURCE_FILENAME_BASE)) <> SOURCE_FILENAME_BASE) {
			continue;
		}
		$imgSources[] = $node;
	}
}
$frameCount = count($imgSources);

echo "Stitching  $frameCount frame(s)...";
		
$imgOut = null;
$imgOutMask = null;
foreach ($imgSources as $frame) {
	$imgSource = imagecreatefrompng(SOURCE_PATH.'/'.$frame);
	
	if (null === $imgOut) {
		$width = imagesx($imgSource);
		$height = imagesy($imgSource);
		$imgOut = imagecreatetruecolor($width, $height * $frameCount);
		$imgOutMask = imagecreatetruecolor($width, $height * $frameCount);
		imagefill($imgOutMask, 0, 0, imagecolorallocate($imgOutMask, 0, 0, 0));
		$offset = 0;
	} else {
		$offset += $height;
	}
	flush();
	
	for ($x = 0; $x < $width; $x++) {
		for ($y = 0; $y < $height; $y++) {
			$pixel = imagecolorsforindex($imgSource, imagecolorat($imgSource, $x, $y));
			$alpha = 255 - $pixel['alpha'] * 2;
			imagesetpixel($imgOutMask, $x, $offset + $y, imagecolorallocate($imgOutMask, $alpha, $alpha, $alpha));
		}
	}
	imagecopy($imgOut, $imgSource, 0, $offset, 0, 0, $width, $height);
	imagedestroy($imgSource);
}
echo " done\n";
imagejpeg($imgOut, OUTPUT_PATH.'/'.OUTPUT_FILENAME.'.jpg', 95);
imagepng($imgOutMask, OUTPUT_PATH.'/'.OUTPUT_FILENAME.'Mask.png', 0);
imagedestroy($imgOut);
imagedestroy($imgOutMask);

echo '<img src="'.OUTPUT_PATH.'/'.OUTPUT_FILENAME.'.jpg?cd='.time().'" width="'.$width.'" height="'.($height * $frameCount).'" alt="" style="padding:0 2px;"/>';
echo '<img src="'.OUTPUT_PATH.'/'.OUTPUT_FILENAME.'Mask.png?cd='.time().'" width="'.$width.'" height="'.($height * $frameCount).'" alt="" style="padding:0 2px;"/>';
?></pre><body></html>
It was never written with user-friendliness in mind, it only supports 32-bit (=rgb+alpha) png images, requires source frames to be numbered with 4-digits (starting from 0000) and outputs a JPEG and PNG image.

Feel free to use, expand, improve or ignore it as you wish.

Cheers,
Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
Post Reply