Palette Troubles


Mr_Munk

Member
Joined
Mar 9, 2005
Messages
226
Age
42
Location
Totnes, Devon, UK
Website
www.notofficial.co.uk
Hi,

Quiest and myself have a small problem with my minigame: When other minigames run (that use FPG files) they automaticaly set the palette. when my Fenix game (which draws it's graphics in vectors and has no FPG files) runs it then has the wrong colour space.

My game needs to somehow load a default palette to reset the colour space, is this possible to make somehow ? Specificaly 1 needs to be black 15 needs to be white 40 needs to be green 10 needs to be dark grey and 22 needs to be red...

Any suggestions welcome :D
 

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Ah they don`t automatically set the palette, that`s what the load_pal(...) command is for :)

As I never had the needs to, I don`t know how to make a palette by hand (and not with fpg edit :D), if anyone knows, tell us please!
 

Oankali

Member
Joined
Jan 5, 2004
Messages
133
Age
54
Location
Andorra
Website
www.nekanium.com
You can use Photoshop to create a palette by hand.
But the little utility that I posted here on GP32Spain some time ago is specially designed to edit color palettes (look for my avatar).

I don't know how works Fenix, but in case you couldn't use directly the palette, just include the palette in a tiny BMP with a paint program like Photoshop and convert the BMP to an FPG and that should do it.

Oankali.
 

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Thanks Oankali!

But the bad thing is, the palettes made with that program are not compatible with Fenix palettes... this is stupid Fenix again...


EDIT:
Okay, I was messing around with the colors and palettes, and I finally got the initial colors you did working... that was some damn trying out random numbers work :D
 

Oankali

Member
Joined
Jan 5, 2004
Messages
133
Age
54
Location
Andorra
Website
www.nekanium.com
Quiest posted on Jul 18 2005 at 09:20 AM said:
Thanks Oankali!

But the bad thing is, the palettes made with that program are not compatible with Fenix palettes... this is stupid Fenix again...

That's why I suggested to create a BMP with the palette.
Can you send me a Fenix palette? I can try to analyze it and add the format to the program. It would be better if you have already the specification of the Fenix palette.
It should be cool, isn't it? B)

Oankali
 
Last edited by a moderator:

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Oh, sure I can send you a Fenix palette! It would be great if it supports them, especially for the get_map_pixel command (where you have to specify colors out of an pal you can`t look inside :D

Just need your eMail.

btw, do you need something specific, or just a random palette?
 

Moogle

.
Joined
Apr 27, 2004
Messages
283
Age
36
Location
Netherlands
Website
Visit site
The solution is easier than you think actually: Load_pal accepts not only palette files but also fpg's, map's and png's.
On the getting the default palette thing(or any palette that is active at that moment), you can easily fetch it with something like:

Code:
palette = new_map(16,16,8);
for(i=0;i<16;i++)
  for(j=0;j<16;j++)
   map_put_pixel(0,palette,i,j,j*16 + i);
  end
end
save_png(0,palette,"palette.png");

resulting in this default palette.
 

Oankali

Member
Joined
Jan 5, 2004
Messages
133
Age
54
Location
Andorra
Website
www.nekanium.com
Quiest posted on Jul 18 2005 at 09:41 AM said:
Oh, sure I can send you a Fenix palette! It would be great if it supports them, especially for the get_map_pixel command (where you have to specify colors out of an pal you can`t look inside :D

Just need your eMail.

btw, do you need something specific, or just a random palette?

My eMail is oankali @ nekanium dot com.

I would prefer an organized palette as it is easier to analyse.
For example:

0-63 : grayscale gradient
64-127: red gradient
128-191: green gradient
192-255: blue gradient

With a palette like this I should be able to find the header and how are saved the colors.
 
Last edited by a moderator:

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
Moogle posted on Jul 19 2005 at 10:42 AM said:
The solution is easier than you think actually: Load_pal accepts not only palette files but also fpg's, map's and png's.
On the getting the default palette thing(or any palette that is active at that moment), you can easily fetch it with something like:

Code:
palette = new_map(16,16,8);
for(i=0;i<16;i++)
  for(j=0;j<16;j++)
   map_put_pixel(0,palette,i,j,j*16 + i);
  end
end
save_png(0,palette,"palette.png");

resulting in this default palette.

You sure rock, Moogle :)

@Oankali: I`ll see what I can do, can`t promise to give such an organised Fenix palette...
 
Last edited by a moderator:

Goity

VIP Sleaze
Joined
Jun 22, 2004
Messages
5,598
Location
Isle of Ewe
On Tyra I just used Load_Pal("fpggame.fpg"); replacing fpggame with the name of your fpg. It worked fine.
 

Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
38
Location
Dteuschland ;)
You could have maybe read it, Goity, that minigame has no FPG! The graphics are generated! :p

And you can`t just load any palette...
 
Top