colour cycling

  • 3 Replies
  • 125 Views

0 Members and 1 Guest are viewing this topic.

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1344
    • mathr.co.uk
« on: July 18, 2019, 11:34:31 PM »
With the new feature in KF 2.14.6 to colour a KFB from the command line, I wrote a small shell script to do colour cycling:

Code: [Select]
#!/bin/bash
f=0
for i in $(seq 0 32 1023)
do
  t=$((i * 360 / 1024))
  echo $f $i $t
  cat template.kfp |
  sed "s/ColorOffset: 0/ColorOffset: $i/" |
  sed "s/SlopeAngle: 45/SlopeAngle: $t/" > tmp.kfp
  ./kf.exe -o input.kfb -c tmp.kfp -p "$(printf %02d $f).png"
  f=$((f + 1))
done
for i in *.png
do
  convert $i -colorspace RGB -geometry 320x180 -colorspace sRGB $i.gif
done
gifsicle --colors 256 --delay 4 --loop --optimize *.png.gif > output.gif

Currently ColorOffset and SlopeAngle etc are integers, when they could theoretically be floats for smoother/finer control.  I'll add to the TODO list...

additional keywords for forum search: color cycle


Linkback: https://fractalforums.org/kalles-fraktaler/15/colour-cycling/2940/

Offline blob

  • *
  • Fractal Fanatic
  • ***
  • Posts: 25
« Reply #1 on: July 19, 2019, 01:56:40 PM »
The script fails on windows because the temp.kfp file is generated in unix format.

Adding a third sed line as follows makes it work: sed -i -e 's/\r*$/\r/' tmp.kfp

Another issue is that the palette from template.kfp doesn't seem to be used. It apparently cycles the color from input.kfb

I have same issue with recoloring single file from command line.

I get this output from bash:

user@COMPUTER /d/Desktop/kf
$ kf.exe -o input.kfb -c template.kfp -p output.png
kf 2.14.6 (c) 2013-2017 Karl Runmo, (c) 2017-2019 Claude Heiland-Allen
loading palette template.kfp
loading map input.kfb
colouring final image
saving PNG output.png

It says it loads palette and recolors but output is same as input.kfb alone.
« Last Edit: July 19, 2019, 02:30:59 PM by blob »

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1344
    • mathr.co.uk
« Reply #2 on: July 19, 2019, 02:51:00 PM »
Another issue is that the palette from template.kfp doesn't seem to be used. It apparently cycles the color from input.kfb
Oh! that kinda makes it useless :(

Quote
loading palette template.kfp
loading map input.kfb
I guess I need to swap the order of these two things in the program.  Thanks for the bug report, expect a new release ASAP (and I'll try to test it properly this time!).

EDIT I think I fixed it, new release coming...
« Last Edit: July 19, 2019, 03:03:40 PM by claude, Reason: 2.14.6.1 fixes it »

Offline blob

  • *
  • Fractal Fanatic
  • ***
  • Posts: 25
« Reply #3 on: July 19, 2019, 04:03:39 PM »
Works as expected now, thanks.  :thumbs:


xx
Colour Cycling?

Started by Torcello on Fractal movie gallery

1 Replies
189 Views
Last post April 01, 2018, 09:30:09 PM
by blob
xx
Forest of colour

Started by timemit on Fractal Image Gallery

0 Replies
159 Views
Last post December 03, 2018, 03:47:09 PM
by timemit