OpenXcom Forum

Modding => Tools => Topic started by: Falko on June 21, 2014, 03:37:04 am

Title: sprite tools
Post by: Falko on June 21, 2014, 03:37:04 am
1st tool
if you go here https://falkooxc.pythonanywhere.com/sprites2png
and select a zipfile that contains a set of sprites like armors or units(can be >200 files per armor) [files have to be directly in the zipfile not in a subfolder]
then you select how many columns you want
and on the click on getpng you will get a png for download that contains all sprites in an ordered list
so instead of
Code: [Select]
  - type: MYNEWUNIT.PCK
    width: 32
    height: 40
    files:
      0: Resources/mymod/MYNEWUNIT/
you do
Code: [Select]
  - type: MYNEWUNIT.PCK
    subX: 32
    subY: 40
    width: 512 #needs the real image width 512 is example
    height: 720 #needs the real image height 720 is example
    files:
      0: Resources/mymod/MYNEWUNIT.png
that way you make your mod easier to manage (pirates mod has >10000 files !) and reduce filesize by >80% (if the sprites are very similar)

2nd tool
here https://falkooxc.pythonanywhere.com/palconvert you can upload a image and convert its colors
at the moment you can only convert images that have "tftd - battlescape"-colors into ufo-battlescape colors
i attached a file where one can compare the difference this tool makes
to enable conversion of tftd-geoscape or ufopedia images one needs to change the conversion-image that i also attached here
go into your favorite image program
open the converpal.png
the first pixel is the color that appears if i find no match or (at the moment)  it appears for all pixel if i select a non "tftd-barttlescap-depth0" source
the rest of the first line is the target-palette colors 1-255
then you have multiple lines the first pixel color defines the source palette
ff00ff=depth0
ff30ff=depth1
ff50ff=depth2
ff70ff=depth3
ff90ff=ufopedia
ffb0ff=geoscape

in the last lines you will find the source palette with their corresponding first color
or you can select userdefined and the palette/colors of the uploaded image will be used
if you do that you also need to uload a Palette-Convert-File and a Target-Palette-File (under more)

tool 3 :
https://falkooxc.pythonanywhere.com/makegif

gives you the option to make new 4-tile aliens/tanks with a lot less pain than normal
take a look at the docusprites picture for "how it works" (alternative there is another descriptive image here (https://openxcom.org/forum/index.php?topic=2349.msg28706#msg28706)
i take the a big tftd 4tile unit
for all ufo/tftd 4-tile units i have templates where one can edit the single frames of each animation as a complete unit
the splitting in a spritesheet png image is done via web
with the second tool https://falkooxc.pythonanywhere.com/palconvert you can fix tftd palettes (in most cases its better if you fix the colors of the template before editing/splitting)
in this docu image i wanted to show how to easy switch colors here "yellowish to green" because big ass muton soldiers need a green bigass terror unit not "walking stones"

or you can change existing spritesheets here i made a non-brown/orange version of ethereal (took like 30 seconds )

if you run into errors post the images and choices you uploaded in this thread
Title: Re: sprite tools
Post by: Falko on June 21, 2014, 03:27:54 pm
if anyone tried to convert sprites and run into crashes
i made a small error in the example ruleset you need subX,subY, AND weight, height.
Title: Re: sprite tools
Post by: Solarius Scorch on June 21, 2014, 05:39:04 pm
Works like a charm. :)

I think there'll be a lot of mod updates soon... :)
Title: Re: sprite tools
Post by: clownagent on June 22, 2014, 06:26:58 pm
I tried it with some handobs or armors, but the -png I got always showed the green jump armour from Solarius Scorch,  :P
Title: Re: sprite tools
Post by: Solarius Scorch on June 22, 2014, 07:43:19 pm
I tried it with some handobs or armors, but the -png I got always showed the green jump armour from Solarius Scorch,  :P

Lol.

Apparently I was the first - and only! - to use this program. :P
Title: Re: sprite tools
Post by: Falko on June 22, 2014, 10:49:48 pm
could not reproduce :(
i changed some stuff in the code that could have an influence but since i could not get other/old "files" as output i could not test it .. can you try again?
Title: Re: sprite tools
Post by: clownagent on June 22, 2014, 11:54:25 pm
Now I got an internal server error when I try the conversion:

"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."
Title: Re: sprite tools
Post by: Falko on June 23, 2014, 12:00:30 am
could you attach the zipfile you use here?
Title: Re: sprite tools
Post by: clownagent on June 23, 2014, 12:07:13 am
Ok, now it works.  ;D

My mistake was in the zip-folder was a subfolder with the gifs, instead of just the gifs.
Sorry for not checking your description in detail at the beginning.

Great tool!
Title: Re: sprite tools
Post by: Falko on June 23, 2014, 12:12:36 am
great that it work now
i made the relevant part in the startpost bold now
Title: Re: sprite tools
Post by: Falko on June 23, 2014, 04:32:42 pm
new tool online description in startpost (2nd tool)
try it :)
if you run into errors post the images and choices you uploaded in this thread
Title: Re: sprite tools
Post by: robin on June 26, 2014, 10:45:28 pm
is this written in python?
(does an offline version exists?)
Title: Re: sprite tools
Post by: Falko on June 26, 2014, 10:46:33 pm
its written in python and i have it working offline here
Title: Re: sprite tools
Post by: robin on June 26, 2014, 11:00:03 pm
are you using this? https://www.cairographics.org/pycairo/
I'm trying to learn python. still very noob though.
Title: Re: sprite tools
Post by: Falko on June 26, 2014, 11:15:11 pm
no i use offline python3+Pillow and on the web python2+PIL these are "basic" image editing libraries
cairo has more drawing functions you can make vector based images and so on thats not needed here

Code: [Select]
from PIL import Image
import glob,math

def combinesprites(pathglob,nrcols,outfn):
    """path2files,numberofcolumns,outputfilname"""
    ifns=[fn for fn in glob.glob(pathglob) if fn.lower().endswith(".gif") or fn.lower().endswith(".png")]
    ifns.sort()
    if ifns:
        ifiles=[]
        pre=Image.open(ifns[0])
        out=Image.open(ifns[0])
        for x in range(pre.size[0]):
            for y in range(pre.size[1]):               
                out.putpixel((x,y),0)
        for fn in ifns:
            ifiles.append(Image.open(fn))
            ifiles[-1].palette=pre.palette
        out=out.resize((pre.size[0]*nrcols,pre.size[1]*int(math.ceil(len(ifns)/nrcols))))
        addx=0
        addy=0
        for i,im in enumerate(ifiles):
            for x in range(pre.size[0]):
                for y in range(pre.size[1]):
                    out.putpixel((addx+x,addy+y),im.getpixel((x,y)))
            if addx+pre.size[0] < out.size[0]:
                addx+=pre.size[0]
            else:
                addx=0
                addy+=pre.size[1]
        out.save(outfn,optimize=False,transparency=0)

if __name__ == "__main__":
    combinesprites("odata/tftd/tank01/*.gif",16,"out.png")
Title: Re: sprite tools
Post by: Solarius Scorch on June 28, 2014, 05:50:35 am
Falko, I made a sprite sheet which now I cannot open in Photoshop. O_o

This is the first time I can't open any picture in a Photoshop. No idea what's going on.

Screen provided in the attachment.
Title: Re: sprite tools
Post by: Falko on June 28, 2014, 10:20:32 am
if you attach the originalk zip/resulting file i can take a look
Title: Re: sprite tools
Post by: Solarius Scorch on June 28, 2014, 02:21:29 pm
if you attach the originalk zip/resulting file i can take a look

Sure, here it is.

It should be noted that the resulting file works perfectly well in the game and image browser, I just can't edit it with Photoshop (and I really need to, half the reason I made one sprite sheet was that I wanted to remove one particular colour from the sprite, since at one point it started being transparent).
Title: Re: sprite tools
Post by: Falko on June 28, 2014, 02:31:39 pm
the reptoiod zip is empty
the file can be opened with paint.net
but not with aseprite
i could load it with python and save it that resulting file is readable in aseprite
hm can you upload a zipfile with files?
Title: Re: sprite tools
Post by: Solarius Scorch on June 28, 2014, 02:37:50 pm
Sorry, I have no idea what happened to that zip. Attaching it again, it is fine.

EDIT: Still can't open your version of the file... This is intriguing.
Title: Re: sprite tools
Post by: robin on June 28, 2014, 03:46:50 pm
I can open Falko's file (tmp.png) but I can't open Solarius' file (REPTOID.png).
This with Photoshop CS4.
Title: Re: sprite tools
Post by: Falko on June 28, 2014, 05:25:48 pm
fixed
Title: How to make a Tank / Big Alien
Post by: Falko on July 01, 2014, 05:32:48 am
update of 2nd tool + new 3rd tool
tool nr 3:
https://falkooxc.pythonanywhere.com/makegif

gives you the option to make new 4-tile aliens/tanks with a lot less pain than normal
take a look at the docusprites picture for "how it works"
i take the a big tftd 4tile unit
for all ufo/tftd 4-tile units i have templates where one can edit the single frames of each animation as a complete unit
the splitting in a spritesheet png image is done via web
with the second tool https://falkooxc.pythonanywhere.com/palconvert you can fix tftd palettes (in most cases its better if you fix the colors of the template before editing/splitting)
in this docu image i wanted to show how to easy switch colors here "yellowish to green" because big ass muton soldiers need a green bigass terror unit not "walking stones"

or you can change existing spritesheets here i made a non-brown/orange version of ethereal (took like 30 seconds )
Title: Re: sprite tools
Post by: robin on July 01, 2014, 08:02:23 pm
Wow man, you're a python master!
I'm almost 4 month on it and I wouldn't even know where to start, if I had to do something like this.

This third tool will be very useful to me in the future.
Title: Re: sprite tools
Post by: MKSheppard on July 04, 2014, 06:13:56 pm
So how do you recolor existing sprites?
Title: Re: sprite tools
Post by: Falko on July 04, 2014, 06:34:32 pm
look at the step 7 "fix-colors url" and the following steps
there you see how to make a tftd image to ufo palette (battlescape) and further "play" with colors
Title: Re: sprite tools
Post by: Falko on July 18, 2014, 04:58:22 pm
i got the informaqtion that there is a bug with the colorindex 15 in oxc
see image i put 1/4th palette to fe/male front/back to compare game image with "original" sprite only one color makes this problem
so to fix it:
go here https://falkooxc.pythonanywhere.com/palconvert#
select from ufo-battlescape->ufo battlescape
open details and activate the fixcolor15 bug
-> convert
done
Title: Re: sprite tools
Post by: Aldorn on July 19, 2014, 12:24:05 am
I will have a look at it
Thanks once more Falko
Title: Re: sprite tools
Post by: Aldorn on July 23, 2014, 02:02:32 pm
if you go here https://falkooxc.pythonanywhere.com/sprites2png

I used it to convert some handob folders
It does not work for some of them, containing GIF files, as it displays a black background on battlescape, but I think it is due to source GIF files (even if these source GIF files works well without any black background when loaded as a handob folder)

Anyway, it works for many others (including folders containing GIF files)

With split parameter set to 1, it works even to convert a unique file from GIF to PNG without loosing transparent background, that's nice !
Once all are converted to PNG format, I will be able to mod a little myself (from existing files, with credits) using one of recommended free softwares (which do not accept GIF files but PNG)

Huge thanks for tools you provide to community, Falko !  :)
Title: Re: sprite tools
Post by: Falko on July 23, 2014, 02:08:43 pm
if you have zipfiles that do not work please atach these here so i can take a look
the sprite2png tool uses the first image as a base and then "attaches" the other images
if the images have different palettes they could look different .. but normally there they should have the same since there is no need to put a geoscape-image together with a battlescape image
Title: Re: sprite tools
Post by: Aldorn on July 23, 2014, 05:47:20 pm
if you have zipfiles that do not work please attach these here so i can take a look
For example this one, with result of conversion

A question : do you know a way to convert many GIF files to PNG (one to one) ?
Title: Re: sprite tools
Post by: Falko on July 23, 2014, 06:14:36 pm
the files in the zipfile have defined color number 255 as transparent color
as far as i know it should be the color 0
if you google "convert many GIF files to PNG" i fopund many programs that can do that in the first page but i do not know if these tools optimizes the palette while converting the files
i myself have a python script for that
Title: Re: sprite tools
Post by: Aldorn on July 23, 2014, 06:21:53 pm
the files in the zipfile have defined color number 255 as transparent color
ok, thanks for info

i myself have a python script for that
And do you share it ?  ::)
And provide a small tutorial to use it ?  ::) ::)
Title: Re: sprite tools
Post by: yrizoud on July 23, 2014, 07:21:18 pm
For conversions I can recommend XnView. There is a menu-driven interface (Tools/Batch processing) and also a command-line utility ("nconvert")
Title: Re: sprite tools
Post by: Falko on July 23, 2014, 07:24:57 pm
there is not much magic to it
Code: [Select]
from PIL import Image
import sys,os
for args in sys.argv[1:]:
    for root,dirs,files in os.walk(args):
        for f in files:
            if f.lower().endswith(".gif"):
                im=Image.open(f)
                im.save(fn[0:-4]+".png",optimize=False,transparency=0)
if you install python and PIL (or Pillow for python 3) you could just drag and drop a/some folder of images onto the script and it creates png files where it find gif files (overwrittes existing fuiles without conformition)
still think a gui tool is prefered by most but i cant say whats best there
Title: Re: sprite tools
Post by: Aldorn on July 23, 2014, 10:07:25 pm
For conversions I can recommend XnView. There is a menu-driven interface (Tools/Batch processing) and also a command-line utility ("nconvert")
Thanks for the info

However, I will try with python as I am really interested in learning to work with

there is not much magic to it
Code: [Select]
from PIL import Image
import sys,os
for args in sys.argv[1:]:
    for root,dirs,files in os.walk(args):
        for f in files:
            if f.lower().endswith(".gif"):
                im=Image.open(f)
                im.save(fn[0:-4]+".png",optimize=False,transparency=0)
if you install python and PIL (or Pillow for python 3) you could just drag and drop a/some folder of images onto the script and it creates png files where it find gif files (overwrittes existing fuiles without conformition)
still think a gui tool is prefered by most but i cant say whats best there
Thanks for the info, and thank you for the script, I will try it
Title: Re: sprite tools
Post by: Aldorn on July 24, 2014, 12:09:58 am
I think I will need some help...

I installed Python 3.4
I ran easy_install-3.4.exe
I tried to install egg of PIL but it said it was already installed (2.5.1)
I create a .py file and paste your script (changed .gif to .GIF and .png to .PNG as I use uppercase extensions)
But when I drag and drop a folder containing GIF files, nothing happens
Any hint ?

EDIT : I put back gif and png instead of GIF and PNG

I succeeded taking a small (bad) screen capture of error message (1st screen shot)
I tried to rename first .GIF file to .gif but same result (2nd screen shot)
I created a folder with only one file all lowercase, same issue (3rd screen shot)
Title: Re: sprite tools
Post by: Falko on July 24, 2014, 12:31:25 am
ups slight mistake in my code ( remember test before post :) )
Code: [Select]
from PIL import Image
import sys,os
for args in sys.argv[1:]:
    for root,dirs,files in os.walk(args):
        for f in files:           
            if f.lower().endswith(".gif"):
                im=Image.open(root+os.sep+f)
                im.save(root+os.sep+f[0:-4]+".png",optimize=False,transparency=0)
Title: Re: sprite tools
Post by: Aldorn on July 24, 2014, 12:45:01 am
This works ! :D

And this global conversion showed me all GIF files that seem to not have right palette
Thanks again

EDIT : I am now able to play with all these sprites, modify them, create new one as I wish, ... I enjoy it a lot, thanks thanks thanks thanks thanks...
Title: Re: sprite tools
Post by: jStuffer on August 02, 2014, 12:58:28 am
Linux users may use the ImageMagick toolset to merge a list of individual images into a spritesheet. (Win32 builds exist too, I believe)

$ montage ./hand*.gif -adjoin -geometry 32x40 -tile x1 -background transparent hadndob_unmapped.png
-- here all files beginning with hand were merged into 1-row sheet
may use -tile 32x for armor spritesheets (32 columns)

Note, that I'm naming my output 'unmapped', because the process reduces the palette, making it incompatible. Finally, this would require restoring the palette - I just paste the new spritesheet with GIMP into an existing valid image (one of the originals, with good palette), resizing it & removing the original layer; then save as new.

(manual on montage: https://www.imagemagick.org/Usage/montage/ (https://www.imagemagick.org/Usage/montage/))
Title: Re: sprite tools
Post by: Falko on August 02, 2014, 02:39:46 am
yeah i did saw the complicated gimp solution for palette fixing twice now
so i wrote a fixer for that issue
open https://falkooxc.pythonanywhere.com/palconvert
select the same palette in both dropdown menues
click more details
activate "try to fix palette colors"
and convert
that solves images with reduced palette but correct! colors that is the case in most of the wrong color- images
some images have wrong colors these colors are replaced by transparency (0) so such change should be obvious
Title: Re: sprite tools
Post by: XCOMFan419 on August 03, 2014, 06:55:38 pm
So I'm trying to edit the HWP sprites for a mod that I'm making, which is a HWP compilation. I'm trying to make blue alloy tanks, and every time I've tried nothing happens and the template stays the same. I tried several times and still no dice. Mind showing me what's wrong?

I've followed the instructions in the first post by looking at docusprites and still nothing. They remain the same colour.
Title: Re: sprite tools
Post by: Falko on August 03, 2014, 07:58:16 pm
the template i offer does not change its a template that you have to change and upload again
i hope the attached image  (https://openxcom.org/forum/index.php?action=dlattach;topic=2349.0;attach=9962;image)helps
Title: Re: sprite tools
Post by: robin on August 05, 2014, 11:46:23 pm
Falko, I was using your "sprite2png" tool like there was no tomorrow, and it went down.

I hope I haven't been too rough  :P


Edit:
Ok, it just resurrected :)
Title: Re: sprite tools
Post by: Aldorn on August 06, 2014, 12:52:12 am
@Falko : perhaps you just ignore as it was a little bit nerving, but as you did not answer, I draw you attention at this question (https://openxcom.org/forum/index.php?topic=2695.msg28669#msg28669), especially the possibility to select an offset + size of range
Title: Re: sprite tools
Post by: Falko 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 ?
Title: Re: sprite tools
Post by: Aldorn 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
Title: Re: sprite tools
Post by: ivandogovich 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
Title: Re: sprite tools
Post by: Arthanor 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!
Title: Re: sprite tools
Post by: ivandogovich 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.
Title: Re: sprite tools
Post by: RSSwizard 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 . . . ?
Title: Re: sprite tools
Post by: Falko 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
Title: Re: sprite tools
Post by: Dioxine 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.
Title: Re: sprite tools
Post by: oftcrash 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!

Title: Re: sprite tools
Post by: Falko 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
  • tftd-depth0.png1 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth0.png)2 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth0.p.png)
  • tftd-depth1.png1 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth1.png)2 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth1.p.png)
  • tftd-depth2.png1 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth2.png)2 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth2.p.png)
  • tftd-depth3.png1 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth3.png)2 (https://falkooxc.pythonanywhere.com/static/pal/tftd-depth3.p.png)
  • tftd-ufopaedia.png1 (https://falkooxc.pythonanywhere.com/static/pal/tftd-ufopaedia.png)2 (https://falkooxc.pythonanywhere.com/static/pal/tftd-ufopaedia.p.png)
  • tftd-geoscape.png1 (https://falkooxc.pythonanywhere.com/static/pal/tftd-geoscape.png)2 (https://falkooxc.pythonanywhere.com/static/pal/tftd-geoscape.p.png)
  • ufo-basescape.png1 (https://falkooxc.pythonanywhere.com/static/pal/ufo-basescape.png)2 (https://falkooxc.pythonanywhere.com/static/pal/ufo-basescape.p.png)
  • ufo-battlescape.png1 (https://falkooxc.pythonanywhere.com/static/pal/ufo-battlescape.png)2 (https://falkooxc.pythonanywhere.com/static/pal/ufo-battlescape.p.png)
  • ufo-geo.png1 (https://falkooxc.pythonanywhere.com/static/pal/ufo-geo.png)2 (https://falkooxc.pythonanywhere.com/static/pal/ufo-geo.p.png)
  • ufo-research.png1 (https://falkooxc.pythonanywhere.com/static/pal/ufo-research.png)2 (https://falkooxc.pythonanywhere.com/static/pal/ufo-research.p.png)

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)