Importing Masks?

Started by Babar, Sat 13/02/2010 20:02:12

Previous topic - Next topic

Babar

For quite a while now I've had this problem where no matter what I do, it has been impossible for me to import a mask for hotspots, walkable areas, etc. I either get a message that

"This is not a valid mask bitmap. Masks must be 256-colour (8-bit) images, using the first colours in the palette to draw the room areas",

or

"Invalid colours were found in the imported mask. They have now been removed.

When drawing a mask in an external paint package, you need to make sure that the image is set as 256-colour (Indexed Palette), and that you use the first 16 colours in the palette for drawing your areas. Palette entry 0 corresponds to No Area, palette index 1 corresponds to area 1, and so forth."

Now I am certain I am doing this all properly. I ONLY use the basic first 16 colours.. After that I save it as a 256 colour bitmap (if I'm using paint), or I set it to Indexed mode and then save as an 8-bit image if I'm using photoshop or something.

I even made CERTAIN that I was not going outside the main 16 colours by first saving the image as a 16 colour bitmap (in paint) or a 4-bit image (in Photoshop), and then resave it as an 8-bit image, but still no luck.

I usually get the 2nd message, and only get the first when I start experimenting with file formats and colour depth in desperation :D.

It seems weird that such a major thing was not caught out by now, which makes me think maybe I'm doing something wrong, but I have no idea what. I make/made extensive use of the import mask function, because I like my hotspots/walkable areas/walkbehinds to be EXACT, and they can get pretty complex at times, so doing it by hand in the editor is just not feasible.

Thanks in advance!
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

TheMagician

Perhaps you can upload one of your masks for us to have a look at?

Babar

#2
Sure! Here is an example of one that didn't work.

Still, are you saying that you ARE able to import masks without problems? Could you upload an example of a mask that DID work for you? :P

I mentioned this problem in IRC originally, and I got 1 or 2 confirmations that it didn't work for them either, at which point I posted here.

By the way, I'm using AGS 3.1.2 SP1.

EDIT: I realised that the image I gave had extra colours that weren't supposed to be there. While I believe that these extra colours were still all within the 16 colour range, for clarity's sake, I fixed it up and uploaded a new one:

Here!
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Ryan Timothy B

Photoshop shows that your colors are the opposite.


Try doing it backwards? lol

It's been awhile since I've last imported a mask, but I remember it being quite difficult.  It would be much nicer if masks were done automatically by AGS without having to choose the colors, and stops at a total of 16, or gives you an error message saying there are too many masks.  Or it would be nice if you could assign the color to each mask instead of it doing it by color order, where color 1 gets mask 0.

CShelton

#4
For those that may not be aware, masking pixels need to be 100% solid, non-transparent, so don't create masks with anti-aliased edges.

The quick and dirty fix for this palette problem is that you need to have a 256 color image with 16 colors or less in it's palette. You can check your palette in Photoshop by choosing Image | Mode | Color Table (assuming your image is set to indexed color).

If you have more than 16 boxes there, your mask import will not work. You may attempt the following steps to see if you an reduce your palette to just the colors you need.

1. Choose Image | Mode | Lab Color
2. Then Choose Image | Mode | RGB
3. Once the image is in RGB mode, sample each of your colors (with the eyedropper), then flood fill the area that that color came from (making sure anti-aliased is UNCHECKED for the flood fill).
4. Once you've sampled and re-filled all of your colored regions, do the same thing for black and white if they exist.
5. Choose Image | Mode | Indexed Color, when presented with the pop up menu, set the color choice to "Exact". It will tell you the number of colors that it's found, and that number should be 16 or less.
6. Save the final image as a PNG file.

Attached is the corrected palette version of Babar's image, and an image of what the color table should look like.





goodohman

Hi,
Can someone mark the right colors with numbers from 0 to 15 on the "System (Windows) Color Table" above?
Thanks!

Khris

What for? Use 16 colors or less, then reduce the amount of colors to 16 (I do this in PaintShopPro 7) and save the image in the appropriate format.
You might have to recolor two or three areas in AGSEdit but that's it.

Again, what seems to be the problem?
You don't have to know which color ends up as which area ID when you draw them, like I said, use the fill tool to redistribute the IDs if necessary.

SMF spam blocked by CleanTalk