Author Topic: sprite tools  (Read 21462 times)

Offline Falko

  • Commander
  • *****
  • Posts: 810
    • View Profile
Re: sprite tools
« Reply #45 on: August 06, 2014, 01:13:31 am »
could you try again to explain what you expect and what the appluication in modding is/should be?
the mixing of 16-color ranges is usefull because most sprites use only 16 or 32 (one or two lines) in the palette to draw the base color so mixing that allows easy recoloring
whats the point of only 8 colors or only color 15-17 exchanging with color 89-91 ?

Offline Aldorn

  • Commander
  • *****
  • Posts: 764
    • View Profile
Re: sprite tools
« Reply #46 on: August 06, 2014, 01:44:42 am »
could you try again to explain what you expect and what the appluication in modding is/should be?
the mixing of 16-color ranges is usefull because most sprites use only 16 or 32 (one or two lines) in the palette to draw the base color so mixing that allows easy recoloring
whats the point of only 8 colors or only color 15-17 exchanging with color 89-91 ?
Be able to exchange only color 15-17 with color 89-91 without changing the rest, even if it should be colour range by colour range (I mean 15-17 => 89-91 then 75-85 => 125-135 then...)
This would be very powerful
And we would be able to work with transparency-white-grey-black first row, just have to start at minimum from Index 1

A way could be (in terms of GUI I mean) :
- display a big palette with index inside
- ask for from + length
- ask for to

But finally it would be a fully different tool  :o
« Last Edit: August 06, 2014, 01:49:08 am by Aldorn »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: sprite tools
« Reply #47 on: August 12, 2014, 04:15:14 am »
I'm trying to merge some of my HandOb gifs, and keep getting the error:

"The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."  :-\

I have attached one of the .zip files. 

I have tried with three different sets with graphics I have made, and those made by others.   I'm not sure where I'm going wrong.

Cheers, Ivan :D

Offline Arthanor

  • Commander
  • *****
  • Posts: 2560
  • XCom Armoury Quartermaster
    • View Profile
Re: sprite tools
« Reply #48 on: August 12, 2014, 04:26:52 am »
The tool looks inside the zip for the gifs, finds a folder and doesn't know what to do with it. Sadly, it doesn't "think" of looking inside that folder for the gifs.

You need just the .gifs straight in the archive. The best way to get that for me was to go straight in the folder that contains the handobs, select them all and select "add to archive" or whichever your equivalent is. Don't right click on the folder and select "create archive", otherwise the archive will contain a folder.

Hope this helps!

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: sprite tools
« Reply #49 on: August 12, 2014, 04:57:52 am »
OK, I think I get it now!!  ;D  Thanks!

Edit:  Woot! it worked.  XD  Idk why I couldn't figure that out.

Offline RSSwizard

  • Colonel
  • ****
  • Posts: 442
    • View Profile
Re: sprite tools
« Reply #50 on: August 25, 2014, 12:07:54 am »
Is it possible to change the size of the PROJECTILES?
I understand 3x3 was enough for Xcom

But id like to experiment with larger projectiles (like a big orb plasma blast, or smoke trail that expands) . . . So id be shooting for 7x7. Any normal size ones id just transpose.

Are the projectile image placements (per tic/frame?) centered or has the 3x3 size already been figured into their alignment on the trajectory path . . . ?

Offline Falko

  • Commander
  • *****
  • Posts: 810
    • View Profile
Re: sprite tools
« Reply #51 on: August 25, 2014, 01:12:23 am »
dont know what that has to do with this topic but no you cant change the size
you can make longer projectiles see laser the laser-beam looks longer than 3*3 but the height is fixed

Offline Dioxine

  • Commander
  • *****
  • Posts: 5314
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: sprite tools
« Reply #52 on: August 25, 2014, 11:07:52 am »
Well this is not true, Falko, bigger projectiles are still drawn; the overflowing pixels are drawn below the 3x3 window. Unless this was "fixed" recently.

Offline oftcrash

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: sprite tools
« Reply #53 on: September 12, 2014, 07:23:00 pm »
Falco, do you happen to have a public code repo? I saw that you posted some of the scripts you wrote, but I'd love to take a closer look at some of the palette fixing and conversions. I wrote my own (ugly) python script to recursively traverse a directory and convert any GIF files to PNG using Imagemagick, and then later PIL when I saw your example. It works, but I'm still having some issues with the palettes. I'd love to take a closer look at your scripts.

Thanks!


Offline Falko

  • Commander
  • *****
  • Posts: 810
    • View Profile
Re: sprite tools
« Reply #54 on: September 12, 2014, 08:05:40 pm »
currently in my spare time  i work on putting all tools together in a nice modern styled website
but that takes time
if i have a usable and mostly feature complete site online i can uload the source
after installing python + some modules a offline-version of this website would be possible
but i cant say when i am ready
for now i can give hints how i handle palettes
setting a palette
the easiest is just bruteforce replacement of the palette data
Code: [Select]
palimg=Image.open("tftd-depth0.png")
im=Image.open("filename.gif")
im.palette.palette=palimg.palette.palette
im.save("filename_fixed.png",optimize=False,transparency=0)

working palette images are here https://falkooxc.pythonanywhere.com/palconvert
Spoiler:
  • tftd-depth0.png12
  • tftd-depth1.png12
  • tftd-depth2.png12
  • tftd-depth3.png12
  • tftd-ufopaedia.png12
  • tftd-geoscape.png12
  • ufo-basescape.png12
  • ufo-battlescape.png12
  • ufo-geo.png12
  • ufo-research.png12

bit by bit manipulations are easy just do something like this:
Code: [Select]
#replaces color 15 with color 14
im=Image.open(fn)
for x in range(im.size[0]):
for y in range(im.size[1]):
if im.getpixel((x,y))==15:
im.putpixel((x,y),14)