OpenXcom Forum

Modding => Resources => Topic started by: MKSheppard on September 19, 2013, 12:41:44 am

Title: Palettes for XCOM in GIMP/Paintshop format
Post by: MKSheppard on September 19, 2013, 12:41:44 am
Just what the header of this thread says...

Anyone have them?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: xracer on September 19, 2013, 03:59:25 am
hope this helps

https://www.ufopaedia.org/index.php?title=PALETTES.DAT
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: SupSuper on September 19, 2013, 05:59:11 am
Here you go, I converted them to PAL format, should work in most image editors.

NOTE: Bigobs images can't use the last 16 colors of the Battlescape palette, as they are reserved for the Ufopaedia UI:
(https://i.imgur.com/3yPd3sf.png)
If you're having the image editor auto-match the palette, one way to prevent this is to replace them with some dumb color like magenta so they don't get used.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: tyran_nick on September 19, 2013, 07:57:40 pm
This is very useful, thanks!
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Hadan on September 28, 2013, 01:44:26 pm
I am sure the information is present somewhere, but maybe it would be helpfull to have it here:
Which Screen in OXC uses which palette?

My specific question:
Which palette is used on the euipment-screen and in ufopeadia?

greetz
Hadan
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: SupSuper on September 28, 2013, 05:34:08 pm
I am sure the information is present somewhere, but maybe it would be helpfull to have it here:
Which Screen in OXC uses which palette?

My specific question:
Which palette is used on the euipment-screen and in ufopeadia?

greetz
Hadan
I thought they were self-explanatory. :P Inventory screen uses Battlescape palette, UFOpaedia uses whatever's appropriate (Basescape for facilities, Battlescape for weapons/armor, UFOpaedia for the rest).
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Hadan on September 28, 2013, 07:06:55 pm
Thanks!
Inventory screen uses Battlescape palette
That and Ufopeadia I wasnt sure about.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Warboy1982 on October 01, 2013, 11:52:04 pm
don't use gimp. gimp "optimizes" paletted images and strips out important information.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: SupSuper on October 02, 2013, 02:17:30 am
don't use gimp. gimp "optimizes" paletted images and strips out important information.
Well really every image editor does if you don't tell it otherwise. You gotta make sure it preserves the original palette.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: moriarty on October 02, 2013, 07:18:57 am
yep, but the GIMP truncates the palette after the last used color, even in the correct mode that should preserve the palette. the issue has been reported but I don't know what the status on a fix is...
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Hadan on October 19, 2013, 02:42:28 pm
What Tools are there to extract pictures from the ufo-files? I would like to learn how to add/change items, but as a noob at ufo-modding I dont really know where to start...

greetz
Hadan
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Warboy1982 on October 19, 2013, 04:20:49 pm
i use bomb bloke's tools
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Hadan on October 24, 2013, 03:23:57 pm
Thank you!  :)

Follow-up question:
Are there any tools that can generate the different perspectives of a weapon that are needed for HANDOB?
I am useless when it comes to thinking/drawing in 3 dimensions  :o
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: pmprog on October 24, 2013, 04:36:42 pm
I guess you have two options - take a current HANDOB set of graphics and draw over them; or model your object in a 3D package, then rotate and take screenshots
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Hadan on October 24, 2013, 05:43:18 pm
take a current HANDOB set of graphics and draw over them
That was Plan B.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Solarius Scorch on January 14, 2014, 11:02:15 am
i use bomb bloke's tools

Is there any other tool to use? Bomb Bloke's converter doesn't work for me, as it has issues with 64 bit Windows (it can't find the Java).
I also tried Ben Ratzlaff's PckView, but it wouldn't open anything for me (it's 10 years old after all).
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: moriarty on January 14, 2014, 12:38:37 pm
there are several versions of pckview out there... look for the one that comes with mapview, that one works for me :)

(luke's mod site should have them: https://openxcommods.weebly.com (https://openxcommods.weebly.com), try this one: https://openxcommods.weebly.com/mapview.html (https://openxcommods.weebly.com/mapview.html))
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Solarius Scorch on January 16, 2014, 06:20:10 am
Many thanks, Moriarty! I can't say it works perfectly, as I'm getting weird critical exceptions, but it's a big progress.
Now let's make some stuff. ;)

EDIT

Now I have another question - sorry if it's silly, but it's my first time modding X-Com. I'm making a custom minigun for fun now and it works fine... However, the palette is broken in Ufopedia while in the battlescape inventory picture it is not.

Battlescape pic (correct):

(https://i200.photobucket.com/albums/aa43/SolariusScorch/Modding/screen001.jpg)

Ufopedia pic (broken):

(https://i200.photobucket.com/albums/aa43/SolariusScorch/Modding/screen000.jpg)

Seeing as it's the same picture that is used in both places, I don't know why this happens. Help, please?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Warboy1982 on January 16, 2014, 06:58:39 pm
don't use the last 16 colours of the battlescape palette for the bigobs. this section of the palette is different in the ufopaedia.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: SupSuper on January 16, 2014, 10:48:19 pm
Yeah the issue is explained here: https://openxcom.org/forum/index.php/topic,1598.msg14891.html#msg14891
I better edit it into my post.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: xracer on January 17, 2014, 07:57:55 am
Could a ASE or ACT Swatch be created so that it can be used in Fireworks?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Solarius Scorch on January 17, 2014, 11:12:55 am
Thanks to the "X-Com graphics in 30 Minutes" guide provided by Moriarty and SubSuper, I am now master of palettes! :D Thanks guys.

I guess I'll post the mod soon. It's nothing big, but maybe someone will use it.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: SupSuper on January 18, 2014, 03:06:32 am
Could a ASE or ACT Swatch be created so that it can be used in Fireworks?
Sure, here you go.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: xracer on January 18, 2014, 10:25:30 am
Thank you very much kind sir, I will test to see if i can just use Fireworks and not jump back and forth to photoshop. Also i have not tested but this uses no alpha transparency right?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: yrizoud on January 18, 2014, 01:47:59 pm
OpenXcom uses a 256-color graphic mode, like the original (or emulates it - the library SDL can even do it behind the scene).
This means that each pixel contains only one piece of information: a 0-255 number, which indicates a color index in the graphic mode's "current palette". This is why the same graphic, displayed in different palettes (battlescape and ufopedia) looks different. In this mode, Alpha is meaningless : there is just no way to blend colors.
And even if two colors look identical in a palette, they ARE different.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Warboy1982 on April 02, 2014, 06:55:20 pm
just an FYI folks: it seems that OSX really doesn't like transparency in png, recommend replacing colour 0 with magenta or supergreen in your palettes
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: civilian on April 26, 2014, 11:43:08 am
A very good (freeware) tool to edit those pallete indexed icons: https://www.aseprite.org/ It is looking a bit crude but is one of the best and most perfect tools i know of.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: volutar on April 26, 2014, 01:20:53 pm
Pros:
+] ASEPRITE has better palette view (variable width and possibility to fit more).
+] Better overall UI experience (MMB drag, alt colorpicker, etc)
Cons:
-] ASEPRITE doesn't like unicode paths (squares instead of non EU chars).
-] 2x2 pixelated UI looks stylish, but inpractical, unnecessary, and annoying.
-] It screws loaded images (making vertical resolution - look at screenshot).
-] No palette manipulation like export/import/load from another image.

After those [-] are fixed - ASEPRITE might be better. But not at the moment.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: volutar on April 26, 2014, 02:51:08 pm
Just for the record.

I've made a palette sheet (for both ufo1 and tftd all 4 palettes).

You can see for yourself how ambiguous they are. Every "highlighted" color from palette in 99% of cases will be screwed, if you will use Photoshop or GIMP, just because they are unable to use color indexes, only RGB values (which are used by multiple indexes). These RGB values will simply refer (or will be converted) to the first index in the list, which most probably is wrong...

Thus I hightly not recommend you to use neither photoshop or gimp for xcom modding use (and paintshop too).

Colorgroup #7 is the most disturbing in tftd palette. It's just black color in terrain (no matter how bright it is), but falling into the blue in the water, when going "dark black".
I extremely doubt it can be emulated for 24bit colors.

Suggestion - is to change these colors to make them not ambiguous. I.e. Change game resources (or just use replacements). Visually they could stay the same but at least oxc modding will be less confusing.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: yrizoud on April 26, 2014, 07:33:12 pm
paintshop... pro ? I haven't used it for ages, but I thought it allowed a real indexed color mode.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: 54x on June 19, 2014, 07:31:42 am
Paintshop Pro plays nice with palettes, and it still does all the way up to X5. I would've thought that photoshop would too with the correct settings.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: SupSuper on June 22, 2014, 01:21:35 am
Someone asked for TFTD palettes so figured I'd post them here too:
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: robin on July 13, 2014, 03:05:05 am
The bottom color line (that "green-ish/blue-ish" grey) of the Battlescape palette is usable for battlescape stuff, right ?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Falko on July 13, 2014, 03:29:51 am
the last 16 colors are greyish
see last line in image to ufo-battlescape https://falkooxc.pythonanywhere.com/palconvert
it can be used for all things that do not appear in ufopedia
handob,floorob,armor (inventory sprite has its own image do not use last 16 colors)
only bigobs can appear in ufopedia but there are exceptions like corpses (autopsy has its own image use research palette) or TANK-weapon-image
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: robin on July 13, 2014, 09:42:15 am
cool. thanks for the answer
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: guille1434 on July 24, 2014, 12:46:49 am
Thanks to the "X-Com graphics in 30 Minutes" guide provided by Moriarty and SubSuper, I am now master of palettes! :D Thanks guys.

I guess I'll post the mod soon. It's nothing big, but maybe someone will use it.

Hello to all... As an X-Com veteran (I bought that game back in 1995, and played a LOT with it till very recent years), I just started to play OXC and its built in modding posibilities. This game is like an old dream came true! X-Com! Moddable! Thanks to everyone involved in this marvellous project...

I wanted to try to mod something in the game, and for my second project I would like to ask for some help...

My first project was to introduce a new Ruleset for a set of improved HWPs, inspired by the Xcomutil "Improved Ground Tanks" option present in the vanilla game ( I will upload it in the correct place).

My second project, which is almost finished was to add a HE ammo clip for the Sniper Rifle (I decided to base all of my work on OpenXcom with the Final Mod Pack added, which is also a blast!).
I could modify the ruleset file without problem, but the problem appears when I want to include a new image for that clip... I just wanted to use the regular ammo clip and change some yellow pixels in it for some red ones. I used Paint.Net, but when the file was viewed in game, the new clip did not look as intended. I think this has something to do with color palettes...

So, here is the question: which sofware can be used to modify graphics files and then be able to include in the game without problem? I currently use Paint.Net or the GIMP...

By the way, could please someone tell me where to find the "X-Com graphics in 30 Minutes" guide provided by Moriarty and SubSuper which was metioned in this same thread?

Thanks for the help pals! :-)

PS: Here are two images atteched, showing the problem I stumbled on...
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Falko on July 24, 2014, 01:00:34 am
paint.net is not useful for palette based images
gimp seems to make problems
i like https://www.aseprite.org/ its simple for simple changes

no idea where a this guide is
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Gifty on July 24, 2014, 01:05:08 am
Gimp is fine as long as you switch to indexed colors and apply the X-Com palette before you do anything else, and reapply it when you're done just for good measure.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Aldorn on July 24, 2014, 01:45:20 am
I could modify the ruleset file without problem
Perhaps is it better to create your own ruleset which will overrule what you need, avoiding you to have to modify FMP anytime it is upgraded
Just name it FMPAddon.rul so that it appears after FMP.rul in mod list, and be sure you always load it after FMP (eventually toogle FMP off/on, then toggle FMPAddon off/on ; or check mod sequence in options.cfg)

So, here is the question: which sofware can be used to modify graphics files and then be able to include in the game without problem? I currently use Paint.Net or the GIMP...
 are two images atteched, showing the problem I stumbled on...
I am absolutely not expert, so others will give you right answers to this question

Anyway, I can try to give you a work around that should allow you to begin your modifications until having all information you asked

Work around :
- make a copy of a valid GIF or PGN => This will load the correct palette and correct background
- rename it, lets say MyFileName.PNG for further explanation
- open it with GIMP, cut existing pixels, then save it. WARNING ! Do not use "save" or "save as" menu options but "File > Overwrite MyFileName.PNG" [not sure as I translate it from french]
- eventually resize it if needed
- eventually fill it with background color (right click option : Edit > Fill In with BG color Ctrl+.) [not sure as I translate it from french] or copy and paste existing background color pixels
- if you don't want to redraw from scratch, you can then open your "bad" file, and copy and paste colored pixels

Do not forget to test it in game as soon as possible before dealing with other images, in order to to be sure it works as you want
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: guille1434 on July 24, 2014, 03:11:59 am
Guys: Thanks for the prompt answers and abundant help!

Falko: I will try Aseprite, it looks loke a nice small software piece, I hope it is more manageable to me than GIMP... :-)

Aldorn: Thanks for the detailed workaround, I will try that method also and then choose the one that suits better to me...

And also, you mentioned the idea of making a "Custom Ruleset" which I also think is a better approach to modding, the problem was that I did not know how the different rulesets loaded in the game (which one overwrote which other). But you mentioned some important info bits, please confirm if I understood them correctly:

1) .rul files present in the Rulesets folder are loaded in alphabetical order, so "A.rul" file will modified or overwritten by "B.rul" and this by "C.rul" etc...

2) .rul files are loaded in the order that is showed in the ruleset list that is generated in the options.cfg file...


Are those two facts true? Do any one of those two facts override the other?

Thanks again to all!!! :-)
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Aldorn on July 24, 2014, 11:54:05 am
Aldorn: Thanks for the detailed workaround, I will try that method also and then choose the one that suits better to me...
It is just a work around, it is better to follow recommendations from others modders

1) .rul files present in the Rulesets folder are loaded in alphabetical order, so "A.rul" file will modified or overwritten by "B.rul" and this by "C.rul" etc...

2) .rul files are loaded in the order that is showed in the ruleset list that is generated in the options.cfg file...


Are those two facts true? Do any one of those two facts override the other?
No as there are opposite...  ;) => 2) is right

- Ruleset files are displayed in alphabetical order => So it is "better" to name ruleset files according to that point, for ergonomic purpose (also I recommended to name FMPAddon.rul for FMP.rul so that it is displayed just after)
- Ruleset files are taken into account depending on activation sequence :
   . if you activate B then A then C => B will be read, then overruled (if has to) by A then overruled (if has to) by C
   . if you activate A then B then C, then inactivate A (or A inactivated by system because of an error !) then reactivate it => first B will be taken into account, overruled by C (if has to) then overruled by A (if has to)
- Options.cfg shows you the real loading sequence => you can also change sequence order directly in Options.cfg, just beware to exit openxcom first

(if has to) : I mean, two rulesets may be totally independant ; one will overrule another, if it defines same properties ; beware that redefining a list should not add elements to previous list but replace old list by the new one, so if you want to add an element to a list, you normally have no other choice to rewrite entire old sequence and include your new element inside
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: guille1434 on July 24, 2014, 11:00:25 pm
So, what determines the order in which mods are loaded by the game engine is the order in which they are activated, and that order gets registered in the options.cfg file. It makes sense to me now. Thanks for the explanation!  8)
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Solarius Scorch on July 24, 2014, 11:58:26 pm
By the way, could please someone tell me where to find the "X-Com graphics in 30 Minutes" guide provided by Moriarty and SubSuper which was metioned in this same thread?

Sorry I haven't responded earlier, I was quite AFK.

Now, I can't remember what I meant half a year ago, but I was probably referring to this very thread... :)
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: guille1434 on July 27, 2014, 01:09:38 am
Success! I managed to use Aseprite software to my purpose! Here is the result: Explosive bullets for the Sniper rifle!  8) I finally could add a correctly shown image in the game screens!
I am working in a small Add-on mod to be used with the Final Mod Pack, and this item will be a part of it!

Thanks to all for the help!
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: robin on August 20, 2014, 01:00:41 pm
I'm doing tiles right now and several colors change when I export the bmp to .PCK files with PCKView.
For example the greys: the 49% one is changed to a 41% grey, the 41% itself shifts into 33%  (a value absent in the palette, which range is: 49-41-35-27%).
Some colors do this “shift to the darker” thing, while others are just slightly different.
The latter isn't a problem since the difference is almost unnoticeable; the former on the other hand can make things considerably darker, which is problematic especially on floors and walls.

This is a picture form a WIP map, upon which I've pasted the original items.
(https://abload.de/img/palette_woesahkey.png) (https://abload.de/image.php?img=palette_woesahkey.png)
You can see how darker that roof floor has become, the metal wall too, and the robot. If you also check around the colors you'll notice lots of them are slightly different from the ones in the palette.

Does PCKView use a different/wrong/incomplete palette?
Is the palette on this thread really correct (its different than the one here https://www.ufopaedia.org/index.php?title=File:5_BattleScapePal.Png for sure, but this one looks even more different than the PCKView colors, there's no correspondence)?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: robin on August 29, 2014, 11:54:21 pm
Ok, PCKView uses a different palette than the one attached here.
I've attached the two palettes below, so you guys can check it.

The discrepancy can noticeably change several colors when importing a bmp (with OXC palette) into a PCK file.

I think MCDedit could be used directly to import/export tile sheets, so making PCKView unnecessary (though MCDedit palette seems not 100% identical to OXC one). But I still wonder why PCKView colors are so different, I want to understand if I'm missing/fucking up something or it's really PCKView that really uses a wrong palette.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: robin on August 30, 2014, 12:16:22 am
Ookk  part 2.

When I import png tilesheets, saved with OXC palette, into MCDEdit (v1.13), it converts the colors into its own palette.. which seems identical to OXC palette but somehow the colors still get messed up (like it's using them in a different order maybe? I don't know, I only know the import changes my colors).

So, when you are doing a png to be imported into MCDEdit, don't save it with the OXC palette, but instead use the palette I've attached below. If you do that, it's safe to import into MCDEdit.
..or at least for now it seems so.

(This seem the most reliable procedure for converting .png tile sheets-->.PCK; avoid PCKView).
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Duke_Falcon on September 04, 2014, 07:24:59 pm
I just wonder that OXC uses the same limited palettes as the vanilla X-com did? Or OXC could handle more colours?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Yankes on September 05, 2014, 07:48:03 pm
Exactly the same palette is used.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: RSSwizard on September 11, 2014, 10:20:47 pm
I dont know about using MCD edit, why do you want to deal with the old MCD format when you can just import graphics into openxcom straight up? Sprite Sheets even.

My advice is just save the images as .GIF rather than .PNG. If it isnt broke dont fix it right?

And custom tailor your palettes to delete colors from them that are off limits, something that is easily recognizable in the image and is unlikely that you would ever use. My suggestion for the color choices are Fuscha (rgb 255 , 0 , 255) for the transparent color and straight red (255, 0, 0) for off limit pixels. Because xcom does not have a good emulation of red in its palettes. By Delete I don't mean actually reduce the color palette choices, I mean replace them with colors that are stupid so you wont use them.

Normally id suggest Teal (0, 255, 255) for the transparency color but it is similar to the blue-seagreen band near the end of the palette and colors might get remapped to it by mistake if you have a bright blue energy blast that you're trying to sprite. It might even get remapped to Teal if you had a bright gray metal sprite with bluish highlights.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: oftcrash on September 12, 2014, 05:47:27 pm
GIF may be more convenient, but they don't play nice on the Mac. Any GIF based mods don't load.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: RSSwizard on September 18, 2014, 10:20:56 pm
Hey are there any tools for Changing the existing palettes?

Im talking about the battlescape palettes for the game itself.

I dont like the kinds of color ranges and choices that I see on the palette (especially the Reds). Im not talking about changing the palette colors fundamentally, such that the existing images would have to be remapped. Its more of a tweak than a warp.

I expect I could probably use a Hex Editor to copy and paste values from an image palette but its still a job (im guessing the battlescape has a stack of palettes used for varying brightness levels just like Doom 2 had).
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: jackstraw2323 on October 28, 2014, 03:36:27 am
To anyone using photoshop, I suggest editing the transparent swatch of the palette to be r:0 G:255 B:0, in order to prevent problems with those of us on OSX. It will be ignored in the final game anyhow and treated as transparent.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: jackstraw2323 on October 29, 2014, 03:29:12 am
just an FYI folks: it seems that OSX really doesn't like transparency in png, recommend replacing colour 0 with magenta or supergreen in your palettes

Yes, shout this from the top of the hills. Took me a while to figure this out, and then found this thread. Would have saved me some time. Maybe someone can reroll the pallet sets and replace the ones here? Or maybe add them to the wiki about sprite modding?
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: yrizoud on October 29, 2014, 12:08:36 pm
What is exactly the problem with PNG format on OSX ? (And why does setting color 0 to #FF00FF or #FFFF00 avoid it?)
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Falko on October 29, 2014, 12:43:18 pm
take a look at the two files
upload them here https://www.fileformat.info/convert/image/metadata.htm
and you see the difference in metadata
as long as i find
Code: [Select]
<tRNS><tRNS_Palette><tRNS_PaletteEntry index="0" alpha="0"/></tRNS_Palette></tRNS> in the metadata the image in macos-oxc is screwed up
and i was told gif also does not work
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: yrizoud on October 29, 2014, 03:00:38 pm
I know pretty well the PNG-8 and GIF formats.
This piece of data (the "tRNS" chunk) states that color number 0 should be rendered fully transparent when the image is displayed over something else. It's only valid and relevant in PNG-8 format, because the RGB variants (24-bit PNG) don't have color numbers.

OpenXcom doesn't need this information, it ignores completely the tRNS chunk on loading. If a graphic is used as a sprite (ie: not a background) it's color 0 which will be transparent. It's similar to how the program completely ignores the "PLTE" chunk which contains the palette, the game displays the image in the current screen's palette anyway.

GIF format has a similar system (Transparent Color Flag bit in the Graphic Control Extension block). It's also ignored by OpenXCOM on loading the images.

So if transparent PNG-8 or GIFs are a problem, it means that every time a piece of a sprite looks transparent in your browser (you see the webpage's color), the image will have a problem on OS-X.

The RGB value of color 0 makes no difference.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: jackstraw2323 on April 02, 2015, 05:24:45 am
I've posted in another thread but this is probably more appropriate. Is there some kind of nuance to how pallets work for basebits? I used the colors for the basebits provided with the first color transparent. I save as a PNG file with this index. My colors are being shifted and blown out in some cases, or even appear to be changing rows. I.E. my light purples from the UFO exteriors are getting shifted to darker purples or blown out white. If I take the same file and replace the transparent index color at #1 with anything, all colors render correctly, but the transparency doesn't work, even though this method works for all the battlescape stuff.

I'm willing to work around it but I'm just not clear on what the actual rules of how this piece works, and I've not yet found any solid documentation.

In the attached image, both the top craft and the lower left craft share pretty much identical color values. The lower right uses similar color selections but again, is blowing out so it seems like the colors are shifting luminosity.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Falko on April 02, 2015, 08:51:58 am
i know of people that use
https://falkooxc2.pythonanywhere.com/spritepalette
to fix their palette
(if the colors are correct the fix command sets the order right)
for basebits drop your gif/png/bmp on the red rectangle
and select fix-palette (ufi-basescape)
convert
download

for a different approach we would need to know the applications you use
not every application can work well with pallettes
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: jackstraw2323 on April 02, 2015, 02:39:55 pm
I'll give that a try. Using Adobe photoshop cc and the palettes from this thread.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Solarius Scorch on April 02, 2015, 06:30:08 pm
If you have any trouble, here's the complete palette set.

The names are mostly straightforward, except for Paleta.act which is used for stuff that appears both in the battlescape an the Ufopaedia, for example item bigobs.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: jackstraw2323 on April 03, 2015, 06:32:42 am
Using the correct basescape pallets with transparency on my test images consisting of the colors in order from left to right demonstrates that certain bands are shifting. Maybe this is by design. In this case index 1 is not converted unlike battlescape.

Image 1 is the greys and image 2 is the ufo light purples that are often used for alloy.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: CanadianBeaver on August 11, 2016, 06:35:29 pm
GIMP palettes for BattleScape and Ufopaedia are here. Zero index is used for transparent background (lime color in the palettes).
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Hobbes on August 11, 2016, 07:41:07 pm
GIMP palettes for BattleScape and Ufopaedia are here. Zero index is used for transparent background (lime color in the palettes).

This might save you some time. It's all the game palettes (Battlescape, Geoscape, UFOPaedia and Basescape) in .pal format. You can import those for GIMP.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: CanadianBeaver on August 11, 2016, 08:05:01 pm
This might save you some time. It's all the game palettes (Battlescape, Geoscape, UFOPaedia and Basescape) in .pal format. You can import those for GIMP.

Unfortunately, GIMP do not import transparent background from .pal palettes. Therefore, GIMP palettes will be shifted by 1 color after imports. I took palettes from message #3 and corrected they after import. The .gpl files in the my message are the original GIMP palette files.

Remarks: GIMP will cut and will compact colors in the indexed .png file, but will not compact (just cuts) in the .gif files.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: hellrazor on August 22, 2016, 09:59:15 am
Jeah its a shame it does that, I usually have to reimport the pallette from another correct picture via grafx2.
I try to avoid gif files, they had some serious issues in the past.

Or using falkoo's sprite tool (https://falkooxc2.pythonanywhere.com/spritepalette#)
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: RSSwizard on November 02, 2016, 10:27:25 pm
Somewhat related I thought I would post this really nifty technique I discovered for working with photoshop and spriting, take a screenshot of the palette editor, paste it into a new image then crop the image to the palette. You can even save that image for future use if you want.

It doesn't matter if that image is in 8bit or not, the point is it provides a literal artist's palette to pick colors from, and at least in PS7 you dont even have to switch to that image to pick a color or use the eyedropper (hold down ALT and it becomes the color picker, and picking a color from the other image will not switch to it).

There are some people who use the Swatches toolbar but I have never found it useful for anything or how to adapt it quickly like others do, and it just adds another layer of hassle to an already hassle-filled program. Id rather just have it as an image like so.

I discovered this actually when I was doing some ZDoom spriting because I wanted to pick colors that were most likely going to be on the ranges I wanted (rather than an off-red diverting to brown, it has an actual color on the palette to start with)
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Solarius Scorch on November 02, 2016, 10:29:31 pm
Yeah, it's not a bad idea. I usually just fix it after conversion (when I'm not simply working on that palette), but I'll try your method.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: RSSwizard on November 02, 2016, 10:39:38 pm
Also another useful tip for fixing colors after conversion is getting the paint bucket tool and turning off the "contiguous" function. Set the tolerance real low or even to 0.

Might be a no brainer, but after working on explosion stuff and having all these little islands of off-colored pixels after converting, going after all of them with the pencil tool is pretty hard and tedious.

Also found it useful because if I decided the entire color-banding on something wasnt coming out correctly I could fix the entire sequence on a macro level by replacing all of the in-between colors as desired. And if you select an area you can make sure that it only affects that sprite at a time, or hits the off-colored pixels on the outside of something but not the ones in the inside of it.

(for explosions and such this is an issue because maybe sparks or flaming bits on the outside could end up being unusually white or have red spots in them, but you dont want it to affect the white/red spots on the main body of the fireball, so if you select the sprite then de-select the parts you dont wanna effect)

Also good for matting, to get rid of darker colors that you're just not sure are bright enough on the fringe to adequately transition. Or even replace them with colors that are more like the rest of the sprite.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: CanadianBeaver on November 10, 2016, 03:16:33 pm
Also another useful tip for fixing colors after conversion is getting the paint bucket tool and turning off the "contiguous" function. Set the tolerance real low or even to 0.

Might be a no brainer, but after working on explosion stuff and having all these little islands of off-colored pixels after converting, going after all of them with the pencil tool is pretty hard and tedious.

Also found it useful because if I decided the entire color-banding on something wasnt coming out correctly I could fix the entire sequence on a macro level by replacing all of the in-between colors as desired. And if you select an area you can make sure that it only affects that sprite at a time, or hits the off-colored pixels on the outside of something but not the ones in the inside of it.

(for explosions and such this is an issue because maybe sparks or flaming bits on the outside could end up being unusually white or have red spots in them, but you dont want it to affect the white/red spots on the main body of the fireball, so if you select the sprite then de-select the parts you dont wanna effect)

Also good for matting, to get rid of darker colors that you're just not sure are bright enough on the fringe to adequately transition. Or even replace them with colors that are more like the rest of the sprite.

It is a simple - DO NOT USE .png with GIMP for OpenXcom - USE ONLY .gif! And each time when you have loaded image do - Colors - Map - Set colourmap - {pallete}
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: ohartenstein23 on November 10, 2016, 03:21:37 pm
I export .png files from GIMP for the sprites I've been making and have had no problems.  It's easy to keep a project (.xcf) file as a template with the proper image mode and palette, save your wirking sprite to a new .xcf, then export when it's ready to get in game.  I can post my templates here if that's help anyone making battlescape sprites in GIMP.
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: CanadianBeaver on November 10, 2016, 03:27:54 pm
I export .png files from GIMP for the sprites I've been making and have had no problems.

Look it better, because all colours have shifted by 1 step in palette (after apply the pallete)
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: ohartenstein23 on January 12, 2018, 06:27:34 pm
Yes, I had the issue on conversion from an already indexed .gif imported to GIMP, re-applying the palette, then exporting again, but not with images where I started with an .xcf file already in the proper palette.

Edit: For anybody who wants to use GIMP for UFO sprites editing, I've compiled a set of palettes in .gpl format if you want to use them, attached to this post.  Also, if you're running into loading indexed .png files causing the issue of shifting the colormap down one index, this is the fix I've found to work:
Title: Re: Palettes for XCOM in GIMP/Paintshop format
Post by: Solarius Scorch on May 20, 2018, 04:29:55 pm
RSS Wizard,
Your palette for X-Com Files is great, but some people complain that it's too dark to see. Would it be possible to have a brighter version?