English Amiga Board


Go Back   English Amiga Board > Creation > Graphics

 
 
Thread Tools
Old 14 August 2021, 14:02   #1
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,337
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.
Havie is offline  
Old 14 August 2021, 22:09   #2
darkwave
Registered User
darkwave's Avatar
 
Join Date: May 2004
Location: UK
Posts: 241
Maybe you could use ImageMagick?

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

Code:
convert image.png -background white -alpha remove -alpha off white.png
darkwave is offline  
Old 14 August 2021, 22:15   #3
TEG
Registered User

 
Join Date: Apr 2017
Location: France
Posts: 116
Eventually there is XnView to convert pictures to IFF with perhaps more success

https://www.xnview.com/en/
TEG is offline  
Old 14 August 2021, 23:23   #4
mrv2k
Registered User

 
Join Date: Apr 2020
Location: Slough
Posts: 134
Quote:
Originally Posted by TEG View Post
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.
mrv2k is offline  
Old 14 August 2021, 23:45   #5
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,337
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.
Havie is offline  
Old 15 August 2021, 00:07   #6
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 50
Posts: 5,775
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.
jotd is offline  
Old 15 August 2021, 11:12   #7
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,337
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 is offline  
Old 15 August 2021, 11:55   #8
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,337
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.
Havie is offline  
Old 15 August 2021, 12:49   #9
fxgogo
your average eccentric

fxgogo's Avatar
 
Join Date: May 2019
Location: Richmond / U.K.
Posts: 446
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.
fxgogo is offline  
Old 15 August 2021, 14:31   #10
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL
Posts: 1,810
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).
pandy71 is offline  
Old 15 August 2021, 15:03   #11
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 50
Posts: 5,775
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?
jotd is offline  
Old 15 August 2021, 20:12   #12
Havie
Registered User
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,337
Quote:
Originally Posted by fxgogo View Post
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...
Havie is offline  
Old 16 August 2021, 00:06   #13
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL
Posts: 1,810
Quote:
Originally Posted by jotd View Post
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.
Attached Thumbnails
Click image for larger version

Name:	red-eyed-tree-frog-agalychnis-callidryas_24b.png
Views:	67
Size:	468.4 KB
ID:	72903   Click image for larger version

Name:	red-eyed-tree-frog-agalychnis-callidryas_12b.png
Views:	60
Size:	212.3 KB
ID:	72904   Click image for larger version

Name:	red-eyed-tree-frog-agalychnis-callidryas_16c_24b.png
Views:	55
Size:	88.1 KB
ID:	72905   Click image for larger version

Name:	red-eyed-tree-frog-agalychnis-callidryas_16c_12b.png
Views:	59
Size:	88.1 KB
ID:	72906  
pandy71 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.10969 seconds with 16 queries