![]() |
![]() |
#1 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,908
|
Help Converting Graphics!
So - I have a lot of graphics in png format that I would like to use on the Amiga in my next game (Blitz basic). Problem is that when I load them into PPaint, the black used is colour 0 (or transparent colour) so all black disappears! They are characters with a black border (and black used within them) which obviously becomes transparent. I am wondering if there is an automatic way of changing the colour index of a colour so that it is not recognised as transparent?
In PC Blitz, you can just chose which colour is transparent but on the Amiga it is always colour 0. Otherwise it is a lot (and I mean a lot) of work to remap all the black by hand... Thanks for any help or suggestions. |
![]() |
![]() |
#2 |
Registered User
Join Date: May 2004
Location: UK
Posts: 262
|
Maybe you could use ImageMagick?
https://stackoverflow.com/questions/...ite-background Code:
convert image.png -background white -alpha remove -alpha off white.png |
![]() |
![]() |
#3 |
Registered User
Join Date: Apr 2017
Location: France
Posts: 674
|
Eventually there is XnView to convert pictures to IFF with perhaps more success
https://www.xnview.com/en/ |
![]() |
![]() |
#4 | |
Registered User
Join Date: Apr 2020
Location: England
Age: 53
Posts: 459
|
Quote:
|
|
![]() |
![]() |
#5 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,908
|
Thanks all - will have a look. Had some success changing the background from pink to black but this lost the black outlines on the sprites.
|
![]() |
![]() |
#6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,458
|
using custom python scripts with PIL.Image. Load the image, compute/extract the palette, reorder it if you need to (you will need to!!), and rebuild the binary pics using the palette you want.
In my pacman project there's an example to extract bobs and sprites with a fixed palette. All those external programs don't care about paletted images or the order of the palettes, resulting in headaches... this script https://github.com/jotd666/pacman500...ets/convert.py uses bitplanelib from https://github.com/jotd666/amiga68ktools and builds .bin files (sprites, bobs, bobs bitplanes) from one big png file and a json file describing the various frames. this method allows to edit your pics using gimp (with png and a fixed palette) and as long as the palettes in your script & in the png match, the order of the palette in the png isn't important. Also used that for my Supercars 2 AGA conversion and a few other hacks. |
![]() |
![]() |
#7 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,908
|
Again thanks - will have a look although have no idea how Gimp works and always have to use a Youtube tutorial when using it - give me Dpaint or PPaint any day!
|
![]() |
![]() |
#8 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,908
|
Solution found
![]() Looking at what jotd has put, I was going to write my own short program to swap colour indexes but thought I'd have a look at Gimp first and after a few Googles found out how to swap two colours using Colour Exchange option - simples! Just pick the colour you want to swap and swap it with another. Changing the ever present pink to black worked okay as outline of sprites is not pure black. Png loads into Ppaint and can change the background back to pink here and save in iff format if needed. Still a lot of sprite sheets to convert but at least it's an hour or so rather than days of redrawing! Now just need to sort out palette and decide on 16 or 32 colours? Easy option would be AGA dual playfield but graphically game really doesn't need it and as there is no parallax, I will probably go for 32 colours. We shall see. Thanks again for all your ideas - put me on the right track. |
![]() |
![]() |
#9 |
Also known as GarethQ
Join Date: May 2019
Location: Twickenham / U.K.
Posts: 750
|
What program are you creating your sprites in originally @havie? There are a couple of great programs that are focused on sprite creation.
http://grafx2.chez.com/[url] Is closest to our favourite programs on the Amiga and supports older bitmap and palette formats. https://www.aseprite.org I have not used, but looks amazing. It has a big community as well. https://www.cosmigo.com This is a high end option which I have not used but gets loads of good press and community use. |
![]() |
![]() |
#10 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
My fav pixel editor on PC is mtpaint - http://mtpaint.sourceforge.net/download.html
side to this i use Gimp (particularly useful Dither where 12 bit color uniform color quantization can be performed) also as very important add-on constantly used by me is a Ximagic Color Quantizer http://ximagic.com/q_index.html where SColorQ a.k.a. Spatial Color quantization can do miracles (even as a tool able to create psycho-visually optimal color palettes albeit non uniform from 12 bit color perspective). |
![]() |
![]() |
#11 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,458
|
I used to hate Gimp but after a while I got used to it. Before that I used Paint Shop Pro 9 (before it got bloated by Corel crap).
Can you show examples of 12 bit color uniform color quantization? |
![]() |
![]() |
#12 | |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,908
|
Quote:
|
|
![]() |
![]() |
#13 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,919
|
Quote:
24 bit, 12 bit uniform RGB space , 16 color but 24 bit RGB space, 16 color @ uniform 12 bit RGB space. |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Converting Photon's tuts to C | Spec-Chum | Coders. C/C++ | 41 | 10 May 2021 16:14 |
Flickering graphics using BltBitMap function of graphics.library | balrogsoft | Coders. C/C++ | 16 | 04 February 2020 14:54 |
Converting assembly to C | absence | Coders. General | 34 | 26 June 2010 09:17 |
Converting PCMCIA types | Zetr0 | support.Hardware | 13 | 23 February 2007 02:16 |
Converting disks to ADFs | PixelsAtDawn | support.WinUAE | 12 | 28 August 2002 12:59 |
|
|