aliens

Author Topic: automatic conversion between ufo and tftd palette  (Read 11050 times)

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
automatic conversion between ufo and tftd palette
« on: June 19, 2014, 12:08:01 am »
I  do not like the result ...  :-\

I tried different algorithm ...
from RGB difference such as in bb_s_toolpack\bb_tact\Hybrid.java
to more complicated.

now I think that a human color selection could be produce a better result. :'(

The result is showed in that image

but there are a lot of consecutive color slot duplicate  and some association are not optimal.

I am sorry for the failure  :-[



« Last Edit: June 19, 2014, 12:10:14 am by davide »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #1 on: June 19, 2014, 04:11:59 am »
interesting...

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #2 on: June 19, 2014, 08:19:49 am »
I will try to preset some color association
and add some interactive way to correct the result.

When I obtain a better result I will serialize it in a file and it could be a resource





Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #3 on: June 23, 2014, 05:30:04 am »
could you do me a favour and convert this file automatically to the ufo palette?
the attached file should be tftd battlescape-land palette
could you can convert it and attach here with the coverted file?

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #4 on: June 23, 2014, 08:20:20 am »
I am workin into PCKView to obtain a lookup index from two palette
indeed them are  TFTD palette and UFO battlescalpe palette.

I obtain  the result showed in previus post but it is poor, or alm maximum moderate.

Now I am writing c# code to allows manual interactive modification to it to obtain a better result
(some colors are total missing)

When I do it  I will try to relese the lookup table in various format

After that  I will relese a version of PCKView with the new function  to convert a PCK from a palette to an other
(first as an exe download and after by GIT OX rules)

Todaythe job was in early stage too (I am sorry but I have a very few free time)

see you later


Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #5 on: June 23, 2014, 04:37:20 pm »
i am not really that intested in PCK conversion more gif/png
so i made my own tool https://openxcom.org/forum/index.php?topic=2349.msg24007#msg24007 the correlation is done by matching colors in a rbg-png-image so everyone can use his/her preferred image program

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #6 on: June 25, 2014, 01:27:16 am »
my best





Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #7 on: June 25, 2014, 01:32:29 am »
great!
can you give me that as numbers [index tftd]=[ufo index] or upload a rbg picture with correct colors (not a screenshot - the colors are not the same as in the palette) for both palettes?

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #8 on: June 25, 2014, 01:33:36 am »
could you do me a favour and convert this file automatically to the ufo palette?
the attached file should be tftd battlescape-land palette
could you can convert it and attach here with the coverted file?

I hope that this is compliant with your request
« Last Edit: June 25, 2014, 01:35:31 am by davide »

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #9 on: June 25, 2014, 01:44:23 am »
great!
can you give me that as numbers [index tftd]=[ufo index] or upload a rbg picture with correct colors (not a screenshot - the colors are not the same as in the palette) for both palettes?

I post the gif and e text file with lookup table between TFTD bttleground palette (L0) and UFO battleground palette

My goal is convert TFTD PCK to UFO Palette

What format do you prefer ?

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #10 on: June 25, 2014, 02:00:00 am »
ah the text seems to be what i could easily use thanks
i will create a test file tomorrow (its a bit late here) so we can easily check the convertion online

i am not 100% sure my tftd palette is correct
can you check them?
my manual conversion of the act files did created some errors and i dont know if influenced the colors :(

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #11 on: June 25, 2014, 10:11:26 am »

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #12 on: June 27, 2014, 09:30:47 pm »
so i found the time to work with your numbers today :)

FYI: my tftd palettes were slightly wrong - i fixed that

here the result
i used the bigobs as a compare image in the hope that a lot of the colors are used
first part = original image (tftd depth0 palette)
second part:
first i show the ufo battlescape palette and the tftd-colors i assigned to each ufo color (according to your numbers - at the attached compare image i cut a bit of at the black colors it was long (>16 slightly different black colors))
next the bigobs converted according to the color-assignemnt showed above
third part:
first i show the ufo battlescape palette and the tftd-colors i assigned to each ufo color manually (i also cut a bit of at the black colors)
next the bigobs converted according to the color-assignemnt showed above

you can see differences in some cases:
 the automatic coloring makes a better color substitution then the manual
 sometimes its a matter of opinion (autocannon yellow => green or brown color)
main negative of the automatic conversion: a lot of strange spots/"impurities" easily visible in the corpses

for me it seems manual trumps automatic color assignments not necessarily in regard to color similarity but in less fixing work after conversion


Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: automatic conversion between ufo and tftd palette
« Reply #13 on: June 28, 2014, 05:05:55 pm »
this looks very promising :)

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: automatic conversion between ufo and tftd palette
« Reply #14 on: June 29, 2014, 12:25:22 am »
With my remapped index of UFO palette I added a new palette to PCKView to preview the result

Some TFTD PCKs  showed by my remapped palette
(UFO on the left, TFTD on the right)



what do you think about that ?

What is the index of trasparent color in the UFO palette ?

the background color of my tiles is wrong and ruins the effect

Thank you for any feedback
« Last Edit: June 29, 2014, 12:42:07 am by davide »