English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Graphics (https://eab.abime.net/forumdisplay.php?f=140)
-   -   Help Converting Graphics! (https://eab.abime.net/showthread.php?t=107933)

Havie 14 August 2021 14:02

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.

darkwave 14 August 2021 22:09

Maybe you could use ImageMagick?

https://stackoverflow.com/questions/...ite-background

Code:

convert image.png -background white -alpha remove -alpha off white.png

TEG 14 August 2021 22:15

Eventually there is XnView to convert pictures to IFF with perhaps more success

https://www.xnview.com/en/

mrv2k 14 August 2021 23:23

Quote:

Originally Posted by TEG (Post 1501129)
Eventually there is XnView to convert pictures to IFF with perhaps more success

https://www.xnview.com/en/

NConvert, the command line version is brilliant. I use it to create all the images in my WHDload set. It will batch convert and supports over 500 image types.

Havie 14 August 2021 23:45

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.

jotd 15 August 2021 00:07

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.

Havie 15 August 2021 11:12

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!

Havie 15 August 2021 11:55

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.

fxgogo 15 August 2021 12:49

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.

pandy71 15 August 2021 14:31

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).

jotd 15 August 2021 15:03

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?

Havie 15 August 2021 20:12

Quote:

Originally Posted by fxgogo (Post 1501213)
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.

If I'm using the PC then I tend to work from MS Paint (yes I know) but prefer using the Amiga programs. In this instance, I have all the sprites from another unfinished project but need to convert them and then recolour them to work with the Amiga palette. Plan is to finish it this time...

pandy71 16 August 2021 00:06

4 Attachment(s)
Quote:

Originally Posted by jotd (Post 1501235)
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?

Ok, 4 pictures to illustrate "data flow"

24 bit, 12 bit uniform RGB space , 16 color but 24 bit RGB space, 16 color @ uniform 12 bit RGB space.


All times are GMT +2. The time now is 16:13.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04317 seconds with 11 queries