Author Topic: Palettes for XCOM in GIMP/Paintshop format  (Read 104448 times)

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #45 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.

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #46 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).
« Last Edit: September 01, 2014, 06:50:08 pm by robin »

Offline Duke_Falcon

  • Colonel
  • ****
  • Posts: 153
  • *Visit my DA site - click on the small globe!*
    • View Profile
    • My DeviantArt
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #47 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?

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #48 on: September 05, 2014, 07:48:03 pm »
Exactly the same palette is used.

Offline RSSwizard

  • Commander
  • *****
  • Posts: 793
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #49 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.

Offline oftcrash

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #50 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.

Offline RSSwizard

  • Commander
  • *****
  • Posts: 793
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #51 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).

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #52 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.

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #53 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?

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #54 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?)

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #55 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

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #56 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.

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #57 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.

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #58 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

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Palettes for XCOM in GIMP/Paintshop format
« Reply #59 on: April 02, 2015, 02:39:55 pm »
I'll give that a try. Using Adobe photoshop cc and the palettes from this thread.