Author Topic: Applying palettes in gimp  (Read 5486 times)

Offline hellrazor

  • Commander
  • *****
  • Posts: 2176
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Applying palettes in gimp
« on: June 20, 2015, 02:41:44 pm »
Hi guys,

i am just trying to do some FloorOb and some HandOb's for Rysekliinis grenade Launcher Mod.

I was able to crop together a FloorOb for the Frag Ammo by rescaling and turning the Bigob.
Now i did this with gimp...

And obviously the colorpalette is totally screwed up :-/

See files attached. How can i fix this?
« Last Edit: June 20, 2015, 02:46:33 pm by hellrazor »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1024
    • View Profile
Re: Applying palettes in gimp
« Reply #1 on: June 20, 2015, 04:48:00 pm »
These ones were easy to fix using Grafx2, but it's not always the case.

Really, it's safer and easier to do your complete graphic work (I mean, from start to finish) in any program of the "good list"
https://openxcom.org/forum/index.php/topic,2676.0.html

Offline hellrazor

  • Commander
  • *****
  • Posts: 2176
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Applying palettes in gimp
« Reply #2 on: June 20, 2015, 08:54:41 pm »
These ones were easy to fix using Grafx2, but it's not always the case.

Really, it's safer and easier to do your complete graphic work (I mean, from start to finish) in any program of the "good list"
https://openxcom.org/forum/index.php/topic,2676.0.html

Well thanks for the effort, but i actually wanted to know how to do this myself.
Since there are a couple of sprites i need to do, so this knowing how doing it would help.

I have gimp installed here and i know how to work with it, at least more then with graphx (which i already tried and it screwing up the palette in the same way, and the image
editing is very limited).

Is there a way to fix the palette after i did all the sprites?
A how to or description on actually doing it myself would be really helpful.

Offline hellrazor

  • Commander
  • *****
  • Posts: 2176
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Applying palettes in gimp
« Reply #3 on: June 20, 2015, 09:38:56 pm »
Ok is there noone who can explain this to me in detail?

I do not understand why all of those image editing programs are so complicated....

Offline Hobbes

  • Commander
  • *****
  • Posts: 3432
  • Infiltration subroutine in progress
    • View Profile
Re: Applying palettes in gimp
« Reply #4 on: June 20, 2015, 10:40:05 pm »
Ok is there noone who can explain this to me in detail?

I do not understand why all of those image editing programs are so complicated....

It's quite simple: GIMP screws up XCom palettes, no matter what you do. Either use another editor or get used to it. :)

Offline hellrazor

  • Commander
  • *****
  • Posts: 2176
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Applying palettes in gimp
« Reply #5 on: June 20, 2015, 11:44:00 pm »
It's quite simple: GIMP screws up XCom palettes, no matter what you do. Either use another editor or get used to it. :)

Well i also tried Graphx, but with this programm i can't turn the sprite or cut it or rescale it, and it screwed up the palette also.

Then i tried falcos spritetool
Which can reapply the palette, but only produces *.png... and the Ammosprites draw over the ammobox...

So what can i do know?
« Last Edit: June 20, 2015, 11:55:15 pm by hellrazor »

Offline hellrazor

  • Commander
  • *****
  • Posts: 2176
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Applying palettes in gimp
« Reply #6 on: June 21, 2015, 12:06:20 am »
These ones were easy to fix using Grafx2, but it's not always the case.

Really, it's safer and easier to do your complete graphic work (I mean, from start to finish) in any program of the "good list"
https://openxcom.org/forum/index.php/topic,2676.0.html

Can you describe me in details what you did step by step?

Offline yrizoud

  • Commander
  • *****
  • Posts: 1024
    • View Profile
Re: Applying palettes in gimp
« Reply #7 on: June 21, 2015, 12:47:28 am »
To fix such image in Grafx2 :
(Grafx2 keeps two documents open at the same time. The one you see is called the "main page", and the hidden is called the "spare page")
Before starting :

Putting the colors in the right indices
  • Open the image that you want to fix
  • Use the magnifier then mouse wheel to see a larger part of the image, you'll need it.
  • Switch pages (TAB key, or left-click the page icon )
  • Open an image which has the correct palette for what you're doing. Just pick an image from an openxcom mod that everybody has
  • Right click the page icon, and select "Copy to spare : Palette and remap"
  • Switch pages again
Checking the background color
  • Right-click the fill icon
  • Hover the mouse on a part of the image which "should" be transparent. In the status bar, if you see that it's color 0, you can stop there. The status line should list something like X: 384 Y:243 (■  0)
  • Left click. It replaces every occurrence of this color with color zero

GIF transparency

This is totally optional because openxcom doesn't care about it, but for web usage, you can check that the right transparent color is selected.
  • Click the "layers" icon
  • Check that the number is zero. If it's not, click on the number button, then click on the image in any part that should be transparent
  • Check "Background" if you want the GIF(or PNG) to use transparency. If you want the image to be fully opaque, uncheck it

Offline Hobbes

  • Commander
  • *****
  • Posts: 3432
  • Infiltration subroutine in progress
    • View Profile
Re: Applying palettes in gimp
« Reply #8 on: June 21, 2015, 07:20:35 am »
To fix such image in Grafx2 :
(Grafx2 keeps two documents open at the same time. The one you see is called the "main page", and the hidden is called the "spare page")
Before starting :

Putting the colors in the right indices
  • Open the image that you want to fix
  • Use the magnifier then mouse wheel to see a larger part of the image, you'll need it.
  • Switch pages (TAB key, or left-click the page icon )
  • Open an image which has the correct palette for what you're doing. Just pick an image from an openxcom mod that everybody has
  • Right click the page icon, and select "Copy to spare : Palette and remap"
  • Switch pages again
Checking the background color
  • Right-click the fill icon
  • Hover the mouse on a part of the image which "should" be transparent. In the status bar, if you see that it's color 0, you can stop there. The status line should list something like X: 384 Y:243 (■  0)
  • Left click. It replaces every occurrence of this color with color zero

GIF transparency

This is totally optional because openxcom doesn't care about it, but for web usage, you can check that the right transparent color is selected.
  • Click the "layers" icon
  • Check that the number is zero. If it's not, click on the number button, then click on the image in any part that should be transparent
  • Check "Background" if you want the GIF(or PNG) to use transparency. If you want the image to be fully opaque, uncheck it

Kudos for this explanation :)

Offline hellrazor

  • Commander
  • *****
  • Posts: 2176
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Applying palettes in gimp
« Reply #9 on: June 21, 2015, 08:25:32 am »
I will give this a try now.
I was so frustrated about this yesterday, that i now have to redo all the graphic work i did yesterday already :-/

EDIT: Success! Thanks yrizoud!!!
« Last Edit: June 21, 2015, 09:53:33 am by hellrazor »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8397
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Applying palettes in gimp
« Reply #10 on: June 21, 2015, 12:36:41 pm »
Good for you. :) I'm interested in this. :q

(Although I think a simpler idea would be to use Photoshop. ;) )

Offline hellrazor

  • Commander
  • *****
  • Posts: 2176
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Applying palettes in gimp
« Reply #11 on: June 21, 2015, 12:42:42 pm »
Good for you. :) I'm interested in this. :q

(Although I think a simpler idea would be to use Photoshop. ;) )

Well jeah probably, i actually also made some HandOb's for the Grenade Launcher Ammo.
See attached Screenshots:
« Last Edit: June 21, 2015, 12:48:19 pm by hellrazor »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1024
    • View Profile
Re: Applying palettes in gimp
« Reply #12 on: June 21, 2015, 03:47:44 pm »
After an image is in the wrong palette, you can't fix it back within Photoshop, can you?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8397
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Applying palettes in gimp
« Reply #13 on: June 21, 2015, 04:39:10 pm »
After an image is in the wrong palette, you can't fix it back within Photoshop, can you?

You can. You just need to open it, change the mode to RGB, and then change the picture to the Openxcom palette. Of course you need to prepare the palette first by opening a good file and saving its palette to .pal.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1024
    • View Profile
Re: Applying palettes in gimp
« Reply #14 on: June 21, 2015, 07:30:41 pm »
It's the "change the picture to the Openxcom palette" step that I don't know how you do.
The only way I could image is by using the menu "Image / Mode / Color Table", and "Load", but I just tried, and it replaces the palette entries without remapping the pixels.