Page 1 of 1

Programmers Palettes

Posted: Thu Sep 14, 2017 11:47 am
by paulwratt
Programmers Palettes

preview: http://paulwratt.github.io/programmers-palettes/ (HW-MSX only atm)

palettes for programmers, developers, and designers.

https://github.com/paulwratt/programmer ... aster/docs

an extensive suppliment to gimp-palettes by @denilsonsa

https://github.com/denilsonsa/gimp-palettes


Is anyone interest in this sort of thing?

I thought it might be of interest, because after the shell scripts are developed (using HW-CGA), the next palette I was going to do is the DawnBringer16 mentioned here then the DawnBringer32
https://github.com/paulwratt/programmer ... master/bin

is there any other useful conversion outputs people might use, or palette files, or code output:
https://github.com/paulwratt/programmer ... FORMATS.md

I am planning on add palette files as I need them, but atm I am leaving (Atari) 256 color palettes till later (default.pal nvdi.pal common.pal), and I am not 100% sure what format one might use on 8bit hardware (or even if they can be used), except for MSX2+ VDP palettes

Cheers

Paul

Re: Programmers Palettes

Posted: Thu Sep 14, 2017 6:31 pm
by shoggoth
Dawnbringer 16-color palette sorted to fit the standard NVDI/TOS4 palette layout would make sense.

Re: Programmers Palettes

Posted: Thu Sep 14, 2017 8:08 pm
by mrbombermillzy
Im going to be looking into optimising 8-bit palettes for some Falcon/TT stuff at a later date so would be very interested in an Atari 256 colour version.

Re: Programmers Palettes

Posted: Mon Sep 25, 2017 3:58 am
by paulwratt
can someone remind me of the format of the (NVDI) .pal file, I know its binary, but what are the RGB orders, and there bit depth. I dont have anything to compare it to, so I cant tell atm.

you can reference the colors, but I cant remember the order, here:
http://afros-update.sourceforge.net/aes-skinning.html

BTW I just uploaded a tagged release 170925-HW-CGA, because I finished the html output utilities. So what used to take 3 days now takes 5 minutes, including upload of about 30 files per color set. I also added a Photoshop palette generator as well, which should be very similar to a Atari ST/Falcon/Aranym 256 color palette file.

unfortunately although I can generate and upload any 16 color palette, I wanted to track which color sets were available on what date, so I used the tags to do it, ie one tag per day, unless I modify the tag name convention.

if people are willing to supply either a GiMP palette file (.gpl) with names, or HTML colors (and color names), I would be willing to create a gamers-palettes that contains palettes used in games, from ANY platform.

Cheers

Paul

Re: Programmers Palettes

Posted: Tue Sep 26, 2017 12:58 am
by paulwratt
re: .PAL I worked it out - 256 VDI colors: RGB, 0-1000 as 2 bytes per channel

I will probably have to create new sets, to re-order the color index of Dawnbringer16 palette inline with the Default/NVDI one, so they are visually compatible.

I may be able to produce a .PAL VDI palette file by the end of the day

I want to do a palette file that is hardware ordered 9bit, 12bit and 15bit "strobe" (2x12bit with "fixed" fine control values) for programmers, what format do people use these palettes at the file or include level?

Re: Programmers Palettes

Posted: Tue Sep 26, 2017 2:57 am
by paulwratt
the algorithm I worked up (integer based):

Code: Select all

if DecNum=0 then VDIval=0
if DecNum>0 then VDIval=(DecNum*4)-(DecNum/12)
if VDIval>800 VDIval++

produces:

Code: Select all

no# |    .gpl     |    algorithm   |     actual
  0 : 255 255 255 : 1000 1000 1000 : 1000 1000 1000
  1 :   0   0   0 :    0    0    0 :    0    0    0
  2 : 242   0   0 :  949    0    0 :  949    0    0
  3 :   0 230   0 :    0  902    0 :    0  902    0
  4 :   0   0 242 :    0    0  949 :    0    0  949
  5 :  26 203 187 :  102  796  733 :  102  796  733
  6 : 255 255   0 : 1000 1000    0 : 1000 1000    0
  7 : 230  51 153 :  902  200  600 :  902  200  600
  8 : 217 217 217 :  851  851  851 :  851  851  851
  9 : 128 128 128 :  502  502  502 :  502  502  502
 10 : 128   0   0 :  502    0    0 :  502    0    0
 11 :   0 128   0 :    0  502    0 :    0  502    0
 12 :   0   0 128 :    0    0  502 :    0    0  502
 13 :   0 128 128 :    0  502  502 :    0  502  502
 14 : 182 162  57 :  713  635  224 :  714  635  224
 15 : 128   0 128 :  502    0  502 :  502    0  502

Note the one flaw in color #14, 713=>714.
I will verify that 800 threshold when I first do a 256 color palette, the NVDI.PAL as I have a GiMP palette for it.

as far as 16 colors palette go, I think for the VDI palettes, I'll have two (2) downloads, with new re-mapped 1st 16 colors with A) darker default 240 maths generated colors appended, and B) the lighter common alternate (NVDI/Jinnee) 240 hand/eye picked color ranges appended.

if someone has a standard Atari ST 16 color palette save from a GEM desktop control panel, I can whip up those as well.

Cheers

Paul

Re: Programmers Palettes

Posted: Fri Sep 29, 2017 2:15 am
by paulwratt
OK, for anyone interested ..

here is a modified version of a shell script (incl CygWin) that will output the Dawnbringer16 as VDI color palette. NOTE that it only generates the number of colors found in the GiMP palette file (.gpl), not the full 256, and it does not remap them to the AtariST color order either.

Code: Select all

#!/bin/sh
BN=`pwd`
BN=`basename "$BN"`
if [ "$1" = "" -o "$1" = "--help" ]; then
  echo "palette-gpl2vdi.pal"
  echo "GiMP palette (.gpl) to Atari ST, Falcon, ARAnyM VDI color palette  (.pal)"
  echo "usage: palette-gpl2vdi.pal.sh [--help]|[palette.gpl]"
  echo "notes: the following will be over written."
  echo "       './$BN-dec-24-space.txt' "
  echo "       './$BN.vdi.colors.txt' "
  echo "       './$BN.vdi.hex.pal' "
  echo "       './$BN.vdi.color.pal' "
  echo "naming convention: "
  echo "       '\$BN uses the basename of the current directory'"
  exit 0
fi
if [ ! -f "./$1" ]; then
  echo "Error: not found: './$1'"
  exit 1
fi
if [ ! "`head -n 1 "$1"`" = "GIMP Palette" ]; then
  echo "Error: not a GiMP Palette: './$1'"
  exit 2
fi

grep -E "^[\ 0-9]" "$1" | cut --output-delimiter=, --characters=1-3,5-7,9-11 | tr -d \  | tr , \  > "${BN}-dec-24-space.txt"

RD=`dirname $0`
CN=`grep -c -E "^[0-9]" "./${BN}-dec-24-space.txt"`

printf "" > "./${BN}.vdi.${CN}colors.txt"
printf "" > "./${BN}.vdi.hex.${CN}colors.txt"
printf "" > "./${BN}.vdi.${CN}colors.pal"
printf '#!/bin/sh\nPF=`which printf`\n$PF "' > "./${BN}.vdi.printf.${CN}colors.sh"
for I in `seq 1 $CN`; do
  "$RD/as-channel-2-VDI.sh" `cat "./${BN}-dec-24-space.txt" | head -n $I | tail -n 1` >> "./${BN}.vdi.${CN}colors.txt"
  "$RD/as-VDI-dec-2-hex.sh" `cat "./${BN}.vdi.${CN}colors.txt" | head -n $I | tail -n 1` >> "./${BN}.vdi.hex.${CN}colors.txt"
  for J in `cat ./${BN}.vdi.hex.${CN}colors.txt | head -n $I | tail -n 1`; do
    M="\x`echo "$J" | cut -c 1-2`"
    N="\x`echo "$J" | cut -c 3-4`"
    printf "$M$N" >> "./${BN}.vdi.printf.${CN}colors.sh"
  done
done
printf "\" > \"./${BN}.vdi.${CN}colors.pal\"\n" >> "./${BN}.vdi.printf.${CN}colors.sh"
chmod 0777 "./${BN}.vdi.printf.${CN}colors.sh"
"./${BN}.vdi.printf.${CN}colors.sh"

echo "$CN colors written to '${BN}.vdi.${CN}colors.pal'"

unset CN
unset RD
unset BN
exit 0

I did it this this way, because people might be interested in what the VDI values (0-1000 dec & hex) are, as well as the actual binary output. NOTE place 'palette-gpl2vdi.pal.sh' in the same directory as 'as-channel-2-VDI.sh' and 'as-VDI-dec-2-hex.sh' (from here) and make them executable (chmod a+x ...).


FYI: Using Grafx2
load the 'palette-common.gif' (reference on the page in the above post), then loading in the Dawnbringer16 JASC-PAL file from programmers-palettes, here is what you get:
Image Image

At least now Arne16v20 (AndroidArts.com) and Dawnbringer16 can be visually remapped to the alternate/common NVDI color palette, and a proper .PAL file produced

BTW: I added Arne16v20 (AndroidArts.com) to the programmers-palettes yesterday, using it to develop the VDI assist scripts, later today after I have created a remapped VDI color palette, and various palette-as-image, I will upload the Dawnbringer16 set.

Cheers

Paul