Maintaining Transparency in Photoshop (Any Better Way?)

SpaceWeasel

Chieftain
Joined
Dec 9, 2001
Messages
30
Location
Gainesville, FL (UF)
Hey guys, I just finished figuring out how to maintain palette integrity in photoshop, and I thought I might post my method for doing it. It seems a little hackish so there may be a better way. Please excuse any spelling errors, I'm quite tired =). Here goes:

1. Open the file for the graphics you want to edit. I was editing goodyhuts.pcx to change how the goody huts look in the game.
2. Go to the image menu, mode, then RGB. Now add a new layer. I usually edit all of my graphics on this layer (adding more as necessary, depending on what I'm doing). Most of the in-game still graphics will have either triangular-shaped magenta areas surrounded by green, or magenta with a green grid. Your basic rule of thumb here is "stay inside the green" since that's what will be displayed. If you go beyond the green grid, bits of your new building or whatever will show up on other building icons and it will generally be a mess. If you go outside the magenta diamonds, those bits will overlap out of the tile, which can be desireable.
3. Once you've edited the graphics to your liking and want to save, you will want to go back to the 256 color PCX format. Now, one of the problems with photoshop is that it will ALWAYS blend two discrete color areas at least a little, no matter what you do. Sometimes it will also take the solid magenta and green areas and decide they should be slightly different colors. So the first thing I usually do is go to the color picker and pick magenta (255 0 255). Then go to select, color range, and jack the fuziness up to 200. This will select all of the places where photoshop is blending your graphics with the magenta, which will give them a silly pink "fuzz" in the game. Now, go to edit:fill and fill this area with solid magenta (sometimes I do this on an overlay layer to see how it will look; it will merge down when you convert to PCX). Now, you may need to edit a little more if this creates too jagged of an edge, but after you do so make sure to do this process again. Repeat until it looks good. This also serves the added purpose of making sure all of the solid magenta is one color. Select green in the color picker (0 255 0) and do the same thing; this shouldn't affect your graphics at all unless they have bright green in them.
4. Go to image:mode:indexed color. Now, from the choice of palette types select something like "perceptual" or any type you think looks good, assuming you have made GIFs and such before. Once it looks good, go to the palette menu and select "custom." Chances are no matter what you did, you will see two blocks of colors: one magenta/pink -ish and one green-ish. Now, the first thing to do is go to the VERY FIRST color square (in the top left) and click on it. Change this square to magenta (255 0 255). Now select the SECOND square and change it to green (0 255 0). Now, hold down shift and click-drag to select the blocks of magentaish and greenish. Now you have several options: you could change them to all be one color that resembles the main color you used in your image. If you use lots of colors, don't worry about it and just go to the next option (in my case the graphics were mostly gray so I could have changed it to a shade of gray). The downside is, this might give your image a solid-color border or little flecks of the wrong color, or both. I typically use option 2, which is to change these blocks to some color that my graphic doesn't use, like bright blue. The downside is that you lose some palette spaces, but it shouldn't be too big of a problem. As you edit the palette, keep an eye on the graphic to make sure it looks ok. When you're satisfied hit "ok" and go ahead and save the graphic as a PCX, making sure to back up the original first. Now open Civ3edit (or the game, depending on what you changed) and observe your handiwork!

I hope this is helpful to someone, somewhere, somehow. Also, if you know of a better way to elimiante "blending fuzz" without making it some unused color, please tell me =).

-SpaceWeasel
 
I just leave the image indexed color and work with the existing palette. You'd be surprised what color combinations can trick the human eye into seeing.
 
That's quite true, but it depends what file you're working with. For example, to replace the brown-yelllow paletted goody huts with my gray-black destroyed cities, I was limited to about three colors. Did I mention I was creating the graphics in 3D Studio Max and pasting them in? I could get them to look all right with the existing palette, but they look so much better with my own.
 
Oh I see! Well props to you for using 3DSM. I'm trying to learn it but it's tough! You should consider posting a tutorial of some kind.
 
i have problems creating pics for the ftc using photoshop....

i got negative coloring, and funky colors, not to mention i get duplicates when i reassemble the pics with flicster...

but if i open them individual ftc in the animation shop, they all show up ok....

what gives...
 
I think it's something with Animation Shop. I believe (not sure) that the whole FLC has to have one palette, and there is an option somewhere in the program to set that. Unfortunately, I have only used the program about twice so I have no idea where that option is or how to use it.
 
There is a couple of tricks that you can use in Photoshop for working with 256-colour images and preserving transparencies.
First up, if you are happy with the current palette of the image you're going to play with, you can save it. Go to Image - Mode - Colour Table and you can save the palette there.
If you're editing in RGB, then doing a colour reduction, what you can do is turn diffusion dithering on (in Adaptive colour reduction) but check "Preserve Exact Colours" in the little box there. This is also the place where you'd be loading your saved palette.
As far as repainting the diagonal things, selecting them using a fuzzy colour range is a pretty good idea, but you could try copying the pieces to an alpha channel. This would be pretty simple - use Magic wand tool with a sensitivity of 0, no anti-aliasing, then select your colour, choose "select similar", paste into a empty alpha channel. You may need to paint the selection with white (just invert fg/bg colours and hit backspace). After you've edited away, load the alpha channel, set the background colour to the one you're using (magenta?) and hit backspace.
Save often (in PSD format), and don't forget to delete alpha channels after you're finished editng as you can't have alpha'ed PCX files.

Phew!

Hope some of this is useful.
 
question in Photoshop, im trying to open a pcx from an animation. for example, i open the musketman.pcx and i get something like 45 frames of the whole animation. but, its all magenta and green. first, how can i split up each frame? second, from reading above now i see that if i put it in RGB mode, the magenta and green will go away, is this correct? do i have to switch it back when i save it?
 
In newer versions of photoshop you can tell photoshop to keep certain colors when reducing the image to indexed color. When you have the indexed color dialogue, it will usually say "Forced: None". Klick on "None", change it to "custom". You then have an empty palette on the screen. Click on the first color space, then you can "pick" the color (magenta) from the image that you have open (it's in the background). The same thing with green. Then you'll keep the colors.

If you don't have Photoshop 6 you can make an image that contains the exact green and magenta colors. After reducing the edited image, go to "image/adjust/replace color". You can then replace the "wrong" magentas and greens with the "rigth" ones.
 
Thamis,
Thank you thank you thank you! Brilliant stuff - everyone working with Civ3 graphics needs to read your post closely. That has already saved me so much time!

I've saved a custom forced palatte, and now every time I switch a file to index mode, that palatte comes up as the default. So now it only takes me a couple of seconds to convert any file into Civ3 compatible mode. With batch processing, I can convert any number instantly, automatically.
 
Hey can you help me in making a unit? I made and rendered a unit in Rinoceros (A 3D modling program) as a .bmp file and when I try to copy the images to the storyboard I cant do it, so I converted it to 24-bit true color, I then put my images on and changed it back to the original format, when I opened it in FLICster and changed the civ color the image is totaly screwed up! So I was wodering if you could help me?:confused:

PS:
I Have:
FLICster
Photo Studio
Microsoft Paint
Microsoft Picture It! Publishing
Rinoceros (3D modling program)
:p
 
Maybe I should rephrase that statement I made,
I rendered an image in rhinoceros and saved it as a .bmp picture file. I then made an empty storyboard if FLICster (build 18). For some odd reason I can't paste a bitmap image into that format, so I converted the Storyboard into a bitmap image and pasted the frames into it. Then I attempted to convert the storyboard back to the original format, it worked moderately well but the palette was mixed up, the format was correct though. I then opened the storyboard in FLICster and when I changed the civ color the image was totally messed up!:mad: Help please?:love:
 
Top Bottom