16-bit color and Photoshop 7 (solved)

Started by dronon, Mon 14/08/2006 04:09:32

Previous topic - Next topic

dronon

Now that I've gotten my GUI and game script finished, I'm just about ready to start on my first test game - so the next thing to do is to choose the resolution and color depth I'll be using from now on.  I ran my first experiments in 320x240, and found it way to blocky, so now I'm going to be working at 640x480, and in 16-bit color, since that will help the game run at a decent speed.

The problem I'm having is with one of the images I created in Photoshop 7. I used the gradient tool to gradually change the tint from one end of the image to the other, but when I import it into AGS, instead of a smooth change in color, I have really huge ugly bands of very few colors. My guess is that Photoshop used colors outside AGS' 16-bit palette - any Photoshop suggestions on dealing with this, or with choosing colors in Photoshop in general?  I don't understand Photoshop very well, but it's either that or MS Paint on my computer. I noticed the bands turn out differently in AGS depending on whether I saved the images as BMP, PNG, or GIF. My monitor display is set to 16-bit color at the moment.

It was also interesting to find out that even though I'm importing my sprites at 640x400 for use in a 640x480 game, room coordinates are still expressed in terms of 320x240.

Khris

Did you test the background in-game?
Under certain cirumstances, the editor doesn't display things "correctly".

What happens if in Photoshop you select all (Ctrl-A), then copy the image and paste it into AGSEdit's sprite manager?

dronon

It looks the same in-game as it does in the Sprite manager, and I've tried pasting as well as the regular import method. If it helps, the graphic in question is for my inventory background, and I've uploaded it here.

(checks the link in preview mode) Now that's interesting... viewing the PNG in Firefox also has the ugly bands, but when I download it and open it in Photoshop again, it looks fine.

Gilbert

That's because in PS you work with 24 (32) bit images.
Under 16-bit colour depth each colour channel has only 5 (6)-bit scales, which is 32 (64) colour scale (which is in general even lower precision than the base palette for 256 colour VGA modes) , so when imported into a 16-bit AGS game because of the conversion in colour depth you may experience a colour loss, especially in smooth gradient of colours.

In the past, AGSEdit dithered the images while converting it from 24 bit into 16 bit, however, since this didn't work too well and created some chaotic results for some graphics (as reported by users) the dithering feature was later removed. So the conversion is now 'as-is', which directly hash the 24bit colours into a 16-bit space, most noticiably for creating flat colour bands of colours in gradients.

I never used PS, but I think there're some options for decreasing an image's colour depth, try toying around with these options, and decrease your images to 16-bit space, with a dithering option on, and see if it'd look better. If you're satisfied with it, convert it back to 24-bit and save it as an image for importing. (Well, as far as I know, if you save the images as 16-bit file formats AGSEdit may not be able to import it, so you still need to convert it back to 24-bit first).

dronon

I can decrease an image's color depth in PS (Image --> Mode --> Indexed color), but I can't seem to get it to do so according to a pre-defined 16-bit palette; at this point I'm thinking it's impossible. Going into Edit --> Color Settings, is entering a whole world of confusion. I guess at this juncture I should just abandon the gradient tool altogether, use some other method of shading and hope my colors are compatible upon import.

Gilbert

Well, since I don't have PS, I didn't know it's not included as a basic feature.

After some researching, I'd found that you may try to dither the images with the 5-6-5 filter from this site before importing into your game.

dronon

Yeeha, I think that solved it! Thanks Gilbot!

SMF spam blocked by CleanTalk