14 December 2017, 23:19 | #1 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
How to reduce colors in iff/ilbm images?
Hi! I'm trying to figure out a good workflow for using Cosmigo Pro Motion to create graphics for an Amiga game. Pro Motion can save images as iff but the problem is that those images will be 256 colors.
Is there a tool that can batch reduce the colors of iff images? I tried XNView and NConvert that comes with it. It almost works, colors can be reduced but the order of colors in the palette is altered (the original images made in Pro Motion only uses the first 32 colors). |
15 December 2017, 00:32 | #2 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,645
|
I know this isn't the answer you want, but how married are you to Cosmigo Pro? because grafx2 can work with smaller palettes.
At the very least I am sure you can use it to load your work and save properly, but it won't batch. |
15 December 2017, 02:32 | #3 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
PPaint.
|
15 December 2017, 13:17 | #4 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I second Grafx2 . This app has been a Godsend for me to work/draw amiga graphics.
|
15 December 2017, 13:55 | #5 |
Registered User
Join Date: Dec 2013
Location: GR
Age: 46
Posts: 1,416
|
Grafx2 for the job you want to do. Promotion is a superior package for making 256 color pixel art. It has a truck of features you won't need for a (usually) simple Amiga job.
|
15 December 2017, 15:58 | #6 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,645
|
grafx2 is really great, I refused to use anything but DPaint IV for years, but grafx2 changed all that.
There are some missing features I would still love to have (like color cycling), otherwise it's amazing. |
15 December 2017, 22:13 | #7 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Thanks for your suggestions, I appreciate it! I tried grafx2, it can reduce the palette colour count but for some reason it removes the colours that are not used in the images, is there a fix for this?
To clarify, the graphics are already made for the PC version of the game but need to be reworked for 16 or 32 colours. Pro Motion have good tools to remap colours etc so it would be the best solution to manually reduce the colours and my pixel artist is also used to that program. I'm not familiar with grafx2 and I know that my pixel artist is not too keen on using another tool. This will leave the final conversion to me, and the only thing i would need to be able to do is just reduce the palette with not changing the colours in the used indices. I know I will have to do this several times so i'm not too keen on doing it manually either. I tried Personal Paint and it seemed to be able to reduce the colour count without any problems. It can also be automated with arexx, the only problem now is that I don't have any documentation for the arexx commands for ppaint, is such a reference available? |
16 December 2017, 12:47 | #8 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
I managed to figure out the ARexx commands needed from the examples supplied with PPaint. I made a script that converts all png images in a folder to iff/ilbm reducing colours if you specify the target colour count in the filename (like image[32].png). This method seems to work ok. If more colours than target colour count are used in the image, the colours will be remapped, otherwise the colour count is just reduced (not changing the palette read from the png image). I'm including the script here if somebody else needs it.
Code:
/* Personal Paint Amiga Rexx script */ /* $VER: PngToIff.pprx 1.0 */ /* This script will convert all png images to iff/ilbm in the folder where the script is run. The colours will be reduced if target colour count specified in the filename inside brackets, for example: image[32].png More than 2MB RAM will be needed for larger images */ IF ARG(1, EXISTS) THEN PARSE ARG PPPORT ELSE PPPORT = 'PPAINT' IF ~SHOW('P', PPPORT) THEN DO IF EXISTS('WB31:Apps/PPaint/PPaint') THEN DO ADDRESS COMMAND 'Run >NIL: WB31:Apps/PPaint/PPaint' DO 30 WHILE ~SHOW('P',PPPORT) ADDRESS COMMAND 'Wait >NIL: 1 SEC' END END ELSE DO SAY "Personal Paint could not be loaded." EXIT 10 END END IF ~SHOW('P', PPPORT) THEN DO SAY 'Personal Paint Rexx port could not be opened' EXIT 10 END ADDRESS VALUE PPPORT OPTIONS RESULTS OPTIONS FAILAT 10000 Version 'REXX' IF RESULT < 7 THEN DO RequestNotify 'PROMPT "'txt_err_oldclient'"' EXIT 10 END LockGUI tmpfname = '_filelist.txt' ADDRESS COMMAND 'List >'tmpfname' NOHEAD PAT=(#?.png) LFORMAT="*"%s%s*"" FILES' IF OPEN('listfile', tmpfname, 'R') THEN DO DO FOREVER curfname = READLN('listfile') IF EOF('listfile') THEN BREAK LoadImage curfname 'FORCE QUIET' IF RC = 0 THEN DO LoadBrush curfname 'FORCE QUIET' GetBrushAttributes 'WIDTH' xmax = RESULT - 1 GetBrushAttributes 'HEIGHT' ymax = RESULT - 1 GetBrushAttributes 'HANDLEX' hanx = RESULT GetBrushAttributes 'HANDLEY' hany = RESULT IF POS("[32]", curfname) > 0 THEN Set '"COLORS=32"' 'FORCE' ELSE IF POS("[16]", curfname) > 0 THEN Set '"COLORS=16"' 'FORCE' ELSE IF POS("[8]", curfname) > 0 THEN Set '"COLORS=8"' 'FORCE' ELSE IF POS("[4]", curfname) > 0 THEN Set '"COLORS=4"' 'FORCE' ELSE IF POS("[2]", curfname) > 0 THEN Set '"COLORS=2"' 'FORCE' ELSE Set '"COLORS=256"' 'FORCE' len = LENGTH(curfname) newfname = SUBSTR(curfname, 2, len-6) || ".iff" DefineBrush 0 0 xmax ymax IF RC = 0 THEN DO SetBrushAttributes 'HANDLEX' hanx 'HANDLEY' hany SaveBrush newfname 'FORMAT ILBM' 'FORCE' END END END CALL CLOSE('listfile') END ADDRESS COMMAND 'Delete >NIL: 'tmpfname UnlockGUI Quit 'FORCE QUIET' |
16 December 2017, 14:08 | #9 |
Registered User
Join Date: May 2004
Location: Somewhere secret
Age: 50
Posts: 365
|
Yes, the fix is just include every colour in the image... eg: a 16col image, draw a 16-wide stripe of 1 pixel of each colour. Then when you convert from IFF->RAW just exclude the extra pixels (or cut them off in a hexeditor, whatever you prefer).
|
18 December 2017, 17:49 | #10 | |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,645
|
Quote:
Another tip: load an image with at least one pixel of every color in it, order the palette the way you want, hit zap/reduce, to make sure you just have those. Then you can SAVE The palette. Use format PAL to save, this will only save the palette. Load the palette onto any image you want and it will use the colors and order you saved. |
|
18 December 2017, 19:57 | #11 | ||
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
Quote:
|
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OS X Quick Look plugin for IFF ILBM images | dalton | News | 17 | 01 September 2021 22:24 |
IFF ILBM Commpression Optimiser | Trachu | Coders. General | 7 | 29 May 2016 08:32 |
iff/ilbm on NDOS disk ???? | SkulleateR | support.Other | 10 | 11 February 2016 18:47 |
Reduce size of an IFF image? | BarryB | support.Apps | 18 | 19 September 2015 03:54 |
IFF/ILBM structures .... | freddix | Coders. General | 7 | 18 September 2006 09:54 |
|
|