Thread: [GD-Windows] Image formats (was [Algorithms] Scrolling starfield)
Brought to you by:
vexxed72
From: Andrew G. <ag...@cl...> - 2002-07-31 14:13:25
|
What formats are people using for images these days? We're currently using TGA which "suffices" but isn't great due to Adobe less than embracing the concept of alpha channels. Ideally I'd like something that Supports an alpha channel Supports 32, 24, & 8 bit images I'm not sure if anything out there actually fits the bill for this though. I've thought about writing a plugin for Photoshop to supported saving to targa's that fit the above, but it looks like a whole lot of pain. Ta. Andrew Grant- Climax Brighton -----Original Message----- From: brian hook [mailto:bri...@py...] Sent: 31 July 2002 06:39 To: gda...@li... Subject: Re: [Algorithms] Scrolling starfield > (That code is a few years old.) PSD has alpha, and RLE. Plus it's > easy to export from Photoshop :) I even used the print-size meta info > to size my billboards. I didn't even realize PSD was a documented and/or open file format. File format support these days is rather trying -- I use TGA by default, primarily because it's more predictable than what I get when I save PNG in various packages. And TGA compresses very well (similar to PNG, if not identical) when ZIPped. And it supports a 16-bit file format for those of us still stuck in the dark ages. =) > > - rationale for WEATHER_BLOCK_SIZE = 14? > > Just tweaked until the furthest flakes were invisible. Ah, okay, just wanted to make sure I wasn't misunderstanding what it was. I mucked about with the code and it works beautifully! It took me a bit to get my head screwed on straight with respect to scale at times (the << 17 threw me off for a bit), but it seems to work. I have the ship centered in the star cloud right now, which looks wrong because stars can get between you and the ship, but a simple translation "behind" the ship should fix that. The packing into integers and letting integer wrap handle wrap around is just brilliant and elegant, if not obvious to everyone but me =) Brian ------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code=31 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 |
From: Javier A. <ja...@py...> - 2002-07-31 15:00:09
|
Andrew Grant <ag...@cl...> wrote: > What formats are people using for images these days? We're currently > using TGA which "suffices" but isn't great due to Adobe less than > embracing the concept of alpha channels. Sad to see we're not the only ones bitten by Adobe's TGA zealotism. I had a few and completely unproductive email exchanges with Adobe about this, in the end I gave up talking to them, and our artists simply continued working with Photoshop 6. > Ideally I'd like something that > > Supports an alpha channel > Supports 32, 24, & 8 bit images > > I'm not sure if anything out there actually fits the bill for this > though. I've thought about writing a plugin for Photoshop to > supported saving to targa's that fit the above, but it looks like a > whole lot of pain. There are two things that can be of great help: 1 - Photoshop 7's TGA loader will load the image's alpha channel into a channel if you hold the ALT key while it does the loading. By default it will load the alpha channel into the layer transparency. It always saves the alpha from the layer opacity, so if you have your alpha in a separate channel, you must perform a couple steps (select from alpha, delete from layer). 2 - Using Image | Calculations, you can create a Photoshop action that will remove the layer transparency and put it into an alpha channel. I tried to write a plugin to perform this in a cleaner way, but failed miserably (couldn't even get the sample code to work, and again Adobe's support was worse than unproductive). We did (2) while using Photoshop 6, and along with 7's ALT-while-loading hack, makes things more useable if you adapt your working habits to it. Theory says that the PNG format is much better, but: - The complexity of the format makes for less immediate tools, link with zlib & libpng, test the varieties of the image pixelformat, all that crap. - Forget about loading PNGs during runtime on a PS2. - A full TGA loader is just a few hundred lines of straightforward code. - Dark stories about Adobe's PNG support being equally full of quirks abound. Javier Arevalo Pyro Studios |
From: Jon W. <hp...@mi...> - 2002-07-31 20:36:29
|
> Ideally I'd like something that > > Supports an alpha channel > Supports 32, 24, & 8 bit images > > I'm not sure if anything out there actually fits the bill for this though. > I've thought about writing a plugin for Photoshop to supported saving to > targa's that fit the above, but it looks like a whole lot of pain. PhotoShop 6 saves .tga files like this just fine. Make sure you have an actual Alpah1 channel by creating a new channel in the Channels window, and you're golden. I use 'em all the time for quick experiments. (To load a tga, read 18 bytes, extract size, read 4*width*height bytes and you're done :-) It also seems to load them back in just fine. Haven't tried 7 yet -- did they make it suck? For production use, the deliverable size is really important, so we save the color channel as a JPEG, and the alpha as grayscale JPEG (for translucency) or 1-bit PNG (for cut-out). Our material system can mix/match and interlace these as appropriate on asset load. Artists understand it, because Max has a separate Opacity channel from Diffuse Color channel. Cheers, / h+ |