Welcome to Fractal Forums

Fractal Software => General Discussion => Topic started by: SeryZone on January 04, 2014, 09:42:08 PM




Title: Fractal eXtreme data's
Post by: SeryZone on January 04, 2014, 09:42:08 PM
Hello to all!!! I got some problem. You can see, that Fractal eXtreme don't use normal interpolation, even COSINE!!! It don't gives normal result! But Ultra Fractal gives more colorful images
 (http://s019.radikal.ru/i613/1401/97/0260dde56411.jpg) (http://radikal.ru/fp/d0487bf76f574020b06e80a6f2ec7044) (http://s019.radikal.ru/i606/1401/ac/f2a4948a299b.png) (http://radikal.ru/fp/404987b838564e5999437dfd61ec9d36)

And I think for palette-translator. I use simple 228-colors palette (from Ultra Fractal) and translate EVERY index to FX palette. Result - 228 points.

How to decrypt palette file?
Hex-code of this palette is

(http://i066.radikal.ru/1401/73/83c3af1dbe22.png) (http://radikal.ru/fp/38ec8bebe2484e749d956cf02e39c00f)

This bytes are Boudary Color. It white. Maybe, every programmer know Pascal. OK, let's begin...

Code:
var 
     input,output:file of byte;
begin
     assign(input,'Palette.fxp');
     reset(input, 1);
     //How to read???
end.

Second problem.

I have 4096-colors palette and I want make it same is Fractal eXtreme. OK, Coloring formula is:

#index = ( #iteration/(4096/228) )/Speed;

HOW TO BE WITH ACCELERATION??? I know, it depends from max. iterations. But, how it works???


Title: Re: Fractal eXtreme data's
Post by: panzerboy on January 05, 2014, 01:19:32 AM
You might want to download my command line utilities that convert FX palette to and from text.
http://www.mediafire.com/download/wqshdpxb5v4cz62/FXutilsSource.zip
compiled version (by lcc) http://www.mediafire.com/download/b8oi6686ec0e0xo/fxutils.zip
If you inspect the source code it should tell you the formats of the FX palette files.

I always liked that FX didint add cosine curves and instead strictly linearly interpolated the colours.
If you think about the top of the curve when things are bright that means lots of iterations will be bright and "washed out".
Similarly at the bottom many iterations will be dark
On the 'shoulders' where the interesting colour changes happen, few iterations.
Look at your palettes, there seems to be more black in the UF version, that means lots of iterations that will look the same.
A similarly broad white peak in UF but a nice sharp White peak in FX that will pick out detail.

Indeed I've created palettes that have even sharper peak at the maximum luminance.


Title: Re: Fractal eXtreme data's
Post by: SeryZone on January 05, 2014, 02:30:42 PM
Thanks. I don't learn C++, please, tell me for about this code:

Code:
int main(int argc,char *argv[])
{ int fnarg;
    FILE *palettefile;
FILE *textfile;
char FxPal[PALMAX];
int pivlen; /* Palette index and values length */
int numindex, index, value;
char textline[TXTMAX], origline[TXTMAX];
int txtlncnt;
enum indextype lastindex, currindex;
char *word,*nlpos;
int fxpalpos, fxpallastixpos, pallength;

if (argc < 3) {
/* If less than 2 arguments we call the Usage routine and exit */
Usage(argv[0]);
return 1;
}
/* handle the program options */
fnarg=HandleOptions(argc,argv);
if((textfile=fopen(argv[fnarg],"r"))==NULL) {
fprintf(stderr,"Cant open %s\n",argv[fnarg]);
return 2;
}
if((palettefile=fopen(argv[fnarg+1],"wb"))==NULL) {
fprintf(stderr,"Cent open %s\n",argv[fnarg+1]);
return 3;
}
memset(FxPal,0,PALMAX);
    memcpy(FxPal,FXPL_hdr,FXPL_HdrSize);
memcpy(&(FxPal[FXPL_FlenHi+1]),FXPL_FlenFill,FXPL_FlenFillSize);
FxPal[FXPL_ShowStripes]=1;
    memcpy(&(FxPal[FXPL_ShowStripes+1]),FXPL_SSFill,3);
FxPal[FXPL_CyclePos]=114;
memcpy(&(FxPal[FXPL_CyclePos+1]),FXPL_CPFill,3);
FxPal[FXPL_CycleBackwards]=0;
FxPal[FXPL_CycleSpeed]=30;
memcpy(&(FxPal[FXPL_CycleSpeed+1]),FXPL_CSFill,7);
FxPal[FXPL_InteriorRed]=0xFF;
FxPal[FXPL_InteriorGreen]=0xFF;
FxPal[FXPL_InteriorBlue]=0xFF;
FxPal[FXPL_InteriorBlue+1]=FXPL_ICFill;
FxPal[FXPL_EdgeFillRed]=0;
FxPal[FXPL_EdgeFillGreen]=0;
FxPal[FXPL_EdgeFillBlue]=0;
FxPal[FXPL_EdgeFillBlue+1]=FXPL_EFFill;

fxpallastixpos=FXPL_NumRedEvenIndexes;
fxpalpos=fxpallastixpos+1;
FxPal[fxpalpos++]=0;
numindex=0;
lastindex=unset; /* 1st index should be red colour so this will trigger break */
txtlncnt=0;
while(fgets(textline,TXTMAX,textfile)!=NULL) {
if((nlpos=strchr(textline,'\n'))!=NULL)
*nlpos=0;
txtlncnt++;
strncpy(origline,textline,TXTMAX);
word=strtok(textline," ");
if(strnicmp(word,"index",TXTMAX)==0) {
if(lastindex==unset) {
fprintf(stderr,"line %d error index found before colour type\n%s\n",txtlncnt,origline);
    exit(4);
}
word=strtok(NULL," ");
sscanf(word,"%d",&index);
word=strtok(NULL," ");
if(strnicmp(word,"value",TXTMAX)!=0) {
fprintf(stderr,"value doesnt follow index line %d\n%s\n",txtlncnt,origline);
exit(5);
}
word=strtok(NULL," ");
sscanf(word,"%d",&value);
numindex+=1;
FxPal[fxpalpos++]=(char)index;
FxPal[fxpalpos++]=0;
FxPal[fxpalpos++]=(char)value;
FxPal[fxpalpos++]=0;
} else {
/*          must be a colour type line RED main, Green main, red stripe etc */
if(strnicmp(word,"red",TXTMAX)==0)
              indexbreak(word,&lastindex,&numindex,&fxpalpos,&fxpallastixpos,FxPal,txtlncnt);
    else if(strnicmp(word,"green",TXTMAX)==0)
indexbreak(word,&lastindex,&numindex,&fxpalpos,&fxpallastixpos,FxPal,txtlncnt);
    else if(strnicmp(word,"blue",TXTMAX)==0)
indexbreak(word,&lastindex,&numindex,&fxpalpos,&fxpallastixpos,FxPal,txtlncnt);
else {
fprintf(stderr,"Unexpected %s at line %d\n",word,txtlncnt);
exit(6);
}
}
}
if(lastindex!=unset) {
FxPal[fxpallastixpos]=(char)numindex;
}
pallength=fxpalpos-FXPL_ByteB4Palette;
FxPal[FXPL_FlenLo]=(char)(pallength & 0x00FF);
  FxPal[FXPL_FlenHi]=(char)((pallength&0xFF00)>>8);
fwrite(FxPal,fxpalpos,1,palettefile);
fclose(palettefile);
fclose(textfile);
}

Ye, I researched for sequence. Cool.


Title: Re: Fractal eXtreme data's
Post by: panzerboy on January 06, 2014, 07:09:07 AM
That looks like the code for fxpalload which loads a text file to create (or overwrite) a fractal extreme palette file.
The simple way to see the format of the supplied text is to use the fxpallist program. eg.

Code:
C:\Users\panzerboy\Documents\Fractal eXtreme>fxpallist -i rainbowstripe.fxp
Red
index 27 value 255
index 59 value 255
index 93 value 0
index 218 value 0
Green
index 27 value 0
index 59 value 255
index 115 value 255
index 168 value 0
index 218 value 0
Blue
index 90 value 0
index 131 value 255
index 168 value 255
index 218 value 0
Red Stripe
index 3 value 127
index 15 value 127
index 27 value 0
index 67 value 0
index 78 value 130
index 97 value 128
index 107 value 0
index 147 value 0
index 154 value 124
index 172 value 124
index 183 value 0
index 218 value 0
Green Stripe
index 3 value 0
index 15 value 126
index 33 value 127
index 49 value 0
index 87 value 0
index 103 value 132
index 118 value 133
index 139 value 0
index 158 value 0
index 174 value 141
index 189 value 142
index 210 value 0
index 218 value 0
Blue Stripe
index 3 value 0
index 33 value 0
index 46 value 131
index 68 value 119
index 80 value 0
index 117 value 0
index 128 value 121
index 150 value 125
index 168 value 0
index 197 value 0
index 202 value 132
index 223 value 138

The stripe colours are optional.
I'm not sure if the program tolerates extra spaces so best to seperate the words with a single space character.
To build a palette file use
Code:
fxpalload textfile.txt fxpalletefile.fxp
If you'd like an explanation of the .fxp file format I'll need to read the code too.
It's plain vanilla C BTW not c++.


Title: Re: Fractal eXtreme data's
Post by: SeryZone on January 07, 2014, 10:03:20 AM
OK, I understand.
Do you know, how to work acceleration in coloring???


Title: Re: Fractal eXtreme data's
Post by: panzerboy on January 07, 2014, 11:47:11 AM
Just to be clear... I assume you realise the acceleration isn't stored in the palette files?
I usually use an acceleration of 2 - 3.5, it seems to space out the later stages of a zoom nicely without the colours getting too sparse
eg mostly the same colour on screen.
Often I'll use a speed of 0.417 or .631 to blend the palette of the first few zooms until the accelerations kicks and shows all the palette colours.
Thats a because I'll have set all 228 colour indexes and stripes so intially the stripes are subdued to be revealed later.
I don't know what the maths is the FX uses to work the acceleration the max iterations is involved somehow.
Its startling the first time you adjust the maximum iterations with acceleration and all of the colours shift.