Screen Grab or export Script for each generation

For scripts to aid with computation or simulation in cellular automata.
Post Reply
larrylazzardo
Posts: 10
Joined: September 10th, 2015, 6:39 pm

Screen Grab or export Script for each generation

Post by larrylazzardo » November 24th, 2016, 4:06 am

Hello,

Is it appropriate to ask for help with scripts even though I don't know anything about scripting!!?? :D

I am a visual artist, a painter, and I am trying to make some relatively simple animations of Golly in its most visually appealing activity: MOTION!!! : ) . What these animations require is a way to export or screen-grab each generation in sequence, up to thousands of images or more.

Today I tried out this script which exports a sequence of bmp images: http://pastebin.com/8vVGCgKE
It worked! but I am not completely happy with how the .bmp images look: they don't really render the grid lines between cells very well so I would like to find a way to export each generation in a different format:

perhaps this means a script that screen-grabs each generation. Or perhaps there is a script that can export the information in another way as a vector file or as a .jpg??

Here is a clip of animation I made by manually screengrabbing each generation. Of course the Youtube compression ruins it, but you get the idea: https://www.youtube.com/watch?v=b_BKwqG ... e=youtu.be

Any help greatly appreciated! Even a pointer to where I could keep looking for help.

cheers,
eli

User avatar
dvgrn
Moderator
Posts: 10670
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Screen Grab or export Script for each generation

Post by dvgrn » November 24th, 2016, 8:19 am

larrylazzardo wrote:Today I tried out this script which exports a sequence of bmp images: http://pastebin.com/8vVGCgKE
It worked! but I am not completely happy with how the .bmp images look: they don't really render the grid lines between cells very well so I would like to find a way to export each generation in a different format...
.BMP is a lossless format, so it seems a little odd that the grid lines wouldn't be rendered very well. If you look at the individual .BMP images, do you see anything wrong with them?

If not, then maybe the problem is whatever software you're using to string together the .BMPs into a video. Any lossy compression that happens at that stage might cause that kind of grid-line rendering problem. Maybe try the export script with Golly set to a much smaller window size?
larrylazzardo wrote:perhaps this means a script that screen-grabs each generation. Or perhaps there is a script that can export the information in another way as a vector file or as a .jpg??
Have you considered trying a screen recorder, maybe with Golly running in full-screen mode? It looks like the various top-10 lists mostly have the same software listed.

The next version of Golly has a new feature, the "overlay", with some Lua scripting features that might be useful -- could give a lot more control over the appearance of exported frames. For example, I think it would be fairly trivial to adapt lifeviewer.lua to produce a sequence of PNGs for viewpoint animations along the lines of what LifeViewer can do (click the "Show in Viewer" button for the linked post).

Following that plan, you could use LifeViewer to work out exactly what you wanted a movie of, and get smooth zooms and rotations and color changes and so on if you wanted them. Then transfer the pattern and waypoint script to Golly with File > Open Clipboard, and use the modified lifeviewer.lua to get a sequence of PNGs.

The modified lifeviewer.lua doesn't exist yet, and lifeviewer.lua is still a work in progress anyway -- but _if_ that could be made to work, would it be an interesting option for you?

User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Re: Screen Grab or export Script for each generation

Post by Scorbie » November 24th, 2016, 8:27 am

If you don't mind gifs, you can tweak giffer.lua in Golly's script directory to add gridlines or use this giffer.py (you have to specify the color settnigs.)

larrylazzardo
Posts: 10
Joined: September 10th, 2015, 6:39 pm

Re: Screen Grab or export Script for each generation

Post by larrylazzardo » November 24th, 2016, 8:16 pm

Hi !
.BMP is a lossless format, so it seems a little odd that the grid lines wouldn't be rendered very well. If you look at the individual .BMP images, do you see anything wrong with them?
Yes, but I am not surprised that whatever math that affords .bmp to be lossless and such small file sizes also doesn't account for certain kinds of details. Here is a comparison of the screengrab (left) vs an exported bmp (right)

Image

Although maybe there is some other reason that the export doesn't include the grid lines. There aren't actually any at all in the .bmp.
Have you considered trying a screen recorder, maybe with Golly running in full-screen mode? It looks like the various top-10 lists mostly have the same software listed.
Yes I have, and my problem is that at some point(s) along the way the computer lags which causes the speed of the generations appearance on the screen fluctuate. I am working on a Macbook. I wonder if anyone has experienced fluid long term motion on a more powerful computer? I even tried filming my screen with a camera and the lags are too disruptive.

I notice LifeViewer runs fairly smoothly, I am going to poke around with it and see what I can muster.

Thanks!

User avatar
Andrew
Moderator
Posts: 928
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Screen Grab or export Script for each generation

Post by Andrew » November 25th, 2016, 1:33 am

larrylazzardo wrote:I am working on a Macbook.
Have you tried using the recording function in QuickTime Player? See here for details:

http://osxdaily.com/2010/11/16/screen-recorder-mac/
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
calcyman
Moderator
Posts: 2936
Joined: June 1st, 2009, 4:32 pm

Re: Screen Grab or export Script for each generation

Post by calcyman » November 25th, 2016, 9:59 am

larrylazzardo wrote:Hi !
.BMP is a lossless format, so it seems a little odd that the grid lines wouldn't be rendered very well. If you look at the individual .BMP images, do you see anything wrong with them?
Yes, but I am not surprised that whatever math that affords .bmp to be lossless and such small file sizes also doesn't account for certain kinds of details.
File sizes for .bmp images are *huge* -- there's no compression whatsoever, and each pixel occupies three bytes (for full-colour images). So a 5-megapixel photograph would occupy 15 megabytes as a bitmap.

Also, gridlines aren't exported since they're not part of the pattern. But I imagine you could alter the script to include gridlines without much difficulty.
What do you do with ill crystallographers? Take them to the mono-clinic!

User avatar
dvgrn
Moderator
Posts: 10670
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Screen Grab or export Script for each generation

Post by dvgrn » November 25th, 2016, 11:35 am

larrylazzardo wrote:I notice LifeViewer runs fairly smoothly, I am going to poke around with it and see what I can muster.
Eventually it might not matter too much if LifeViewer runs smoothly or not. If we're using a modified lifeviewer.lua to export frames from an animation, then the computer can take as long as it likes to render each frame, and it will still come out smooth when it's compiled into a video.

Big caveat, though: lifeviewer.lua is still in early alpha stage, so it doesn't support half of the script commands that the Javascript version on the forums can handle. In fact, it doesn't even understand "T" waypoint definitions yet, so for the moment you'd be stuck with simple zooms and pans and so forth, at fixed angles.

I suspect this will change at some point, but I'm not sure exactly when. Still, I think it may be worth your while to get familiar the LifeViewer script commands that can be attached to RLE patterns. Here's another extended example of a LifeViewer waypoint animation (from here):

Code: Select all

x = 859, y = 580, rule = B3/S23
816b2o3b2o$816b2o2bob3o$820bo4bob2o$816b4ob2o2bobo$816bo2bobobobobo$
819bobobobob2o$820b2obobobo$824bo2bo$827bobo$810b2o16b2o$811bo7b2o$
811bobo5b2o24bo$812b2o29b3o$842bo$842b2o4$797bo$797b3o22b2o$800bo21bo
29bo$799b2o22b3o24b3o$825bo23bo$849b2o$827b2o$827b2o$799bo2b2o$800b3o$
801bo3$839b2o$839b2o$853b2o$853b2o$857b2o$857b2o2$789b2o$789b2o2$835b
2o$834bo2bo$796b2o37bobo$796b2o38bo15$829bo$829b3o$776b2o54bo$776bo2bo
51bobo$777b3o52bo$769b2o45bo$721bo47bobo5b3o34b3o$721b3o40bo6bo4bo2bo
33bo19b2o$724bo15bo23b3o4b2o3b2o22b2o11b2o18b2o$717b2o4b2o13b3o15bo10b
o32b2o21bo$718bo18bo18b3o7b2o55b3o$718bobo16b2o20bo66bo$719b2o37b2o65b
2o2$858bo$856b3o$855bo$855b2o$755b2o$755b2o3$813b2o$813b2o3bo$817bobo
4b2o$761b2o4b2o31b2o16bobo2bobo$726b2o33bo5b2o8b2o22bo18bo2bo$726b2o
34b3o12b2o19b3o19b4o$764bo33bo$773b2o45b2o$774bo45b2o$771b3o$771bo68b
2o$840bo$829b2o10b3o$829b2o12bo35$796b2o$796b2o2$776bo$760b2o12b3o$
761bo11bo$761bobo9b2o$762b2o$770b2o23bo11b2o$769bo2bo21bobo10b2o$770bo
bo20bo2bo$771bo22b2o2$774bo$773bobo$773bobo17b2o$764bo9bo19bo$764b3o
24b3o$767bo23bo8b2o$766b2o32b2o$788b2o$788b2o6$776b2o$776b2o$762b2o$
762b2o$758b2o$758b2o4$784b2o$784bo$782bobo$782b2o13$2o$2o20bo$21bobo$
20bobo$21bo3$694bo85b2o$694b3o83b2o$668b2o27bo$29b2o636bo4bo15bo7b2o8b
2o$28bobo636bobobob2o11b3o17bo$29bo636b2obo3b2o10bo18bobo18bo11b2o$
669b3obo11b2o17b2o18bobo10b2o$666b3o4bo16b2o32bobo$666bo2bob3o7bo8b2o
26b2o2b3ob2o$667b2o3b2o6bobo35bo2bo$664b3o2bob3o5bo2bo33bobo3b3ob2o$
37b2o625bo2b2o4bo6b2o34b2o6bob2o69bo5b2o$36bobo626bo3b3obo16b2o105bo5b
2o$37bo628b2obo3b2o15b2o88bo15b3o$667bobobob2o104bobo$667bo4bo107b2o
13b2ob2o$8bo659b2o125b2ob2o$7bobo786bobo$7b2o705b2o13b2o66bo$45b2o667b
2o13b2o$44bobo697b2o$45bo697bo2bo9bo4b2obo$744b2obo7bobo3bob2o4b2o$
747bo7bobo11b2o24b3o5b3o$16bo730b2o4b3ob2o3b5o29b3o3b3o$15bobo714b2o
18bo8bo2bo2bo26bob4ob4obo$15b2o716bo19b3ob2o2b2o3b2o27b2o2bobo2b2o$53b
2o675b3o22bob2o37b3o3b3o$52bobo675bo20bo45bo5bo$53bo697b3o$647b2o105bo
$648bo104b2o$24bo623bobo57b2o$23bobo623b2o57bo$23b2o681bobo$61b2o643b
2o$60bobo590b2o101b2o$61bo590bo2bo99bo2bo$653bobo36b2o62b2o45b2o$654bo
36bobo70b2o37b2o$32bo658bo72bobo$31bobo656b2o7b2o65bo$31b2o666b2o65b2o
$69b2o682b2o$68bobo567b2o7b2o105bo$69bo567bo2bob2obo2bo2b2ob2o95b3o$
637bobo3bob2o2b3o3b3o93bo$638bob2o5b2o4bo4bo$40bo599bob3obo2bob2ob4o$
39bobo598bo5bo2b2obobo$39b2o598b2obob2o4bobo2bo$77b2o561bobo2bob4ob3o$
76bobo561bo2bo2bo4bo$77bo563b2o5b2o2bo$647b2ob2o2$48bo$47bobo$47b2o$
85b2o$84bobo$85bo$701b2o$427b2o272b2o$56bo369bobo$55bobo362b2o4bo$55b
2o361bo2bo2b2ob4o$93b2o323b2obobobobo2bo$92bobo326bobobobo$93bo327bobo
b2o207b2o$422bo205bob2obobo$628b2obobo$64bo370b2o195b2o$63bobo360b2o7b
o$63b2o361b2o5bobo$101b2o330b2o194b2o$100bobo526b2o$101bo$712b2o$711bo
bo$72bo639bo$71bobo574bo$71b2o350b2o223b3o$109b2o313bo226bo$108bobo
310b3o226bobo$109bo311bo228bobo$651bo2$80bo$79bobo$79b2o$117b2o547b2o$
116bobo547b2o$117bo3$88bo557b2o$87bobo555bobo$87b2o556bo$125b2o517b2o
7b2o$124bobo526b2o$125bo$661b2obo$661b2ob3o$96bo570bo$95bobo563b2ob3o$
95b2o563bo2b2o$133b2o524bobo$132bobo506bo16bobob2obo$133bo507b3o15bo2b
ob2o$644bo17bo$643b2o16b2o$104bo553bobo2b2o$103bobo437bo11b2o79bo21b2o
2bo2bo$103b2o437bobo10b2o79b3o24b2o23bob2o$141b2o391bo3b2o2bobo94bo48b
2obo$140bobo390bobo2bo2b2ob2o92b2o$141bo391bobo3bobo144b5o61bo$534bob
4o2bob2o140bo4bo28bo29b3o$536bo3bobob2o143bo2bo25b3o28bo$112bo405b2o
15bo3bobo147b2obo2bo21bo31b2o$111bobo405bo14bo3bobo145bo5bobobo20b2o$
111b2o406bobo12b2o3bo95b2o19b2o27bobo4bo2b2o$149b2o369b2o2b2o109b2o19b
2o27bo2bo2b2o4b2o$148bobo373b2o160b2o9bo$149bo545bobo$547b2o108b2o2bo
33b2o$547b2o108bo3b3o$120bo441b2o94b3o3bo$119bobo439bo2bo95bo2b2o$119b
2o441b2obo$157b2o352b2o52bo$156bobo353bo52b2o$157bo354bobo35b2o218b2o
3b2o$513b2o36bo82bo2bo38b2o92b2o3b2o$548b3o87bo37bobo$128bo407b2o10bo
90b2o36bo$127bobo406bobo94bob2o6bo$127b2o409bo94bo2bo3bo$165b2o347b2o
22b2o92bo3bob3o$164bobo348bo115bo11bo2b2o86b2o$165bo346b3o15b2o102b3ob
o3bo2bobo54b2o30bo5b2o$512bo17bobo101bo3bo2bo4bo14b2o23b2o14bo5b2o25b
3obobo36b2o$532bo98bo6b2obo18bobo23bo16b3obobo27bobo7b2o14b2o13b2o$
136bo378b2o15b2o100b2o24bo26b3o15bobo7b2o21b2o7b2o14b2o$135bobo376bobo
119bo22b2o28bo16b2o7b2o$135b2o264b2o111bo122bo2bo42b2o75b2o$173b2o225b
obo110b2o152b2o14b2o75b2o$172bobo219b2o4bo266bo$173bo218bo2bo2b2ob4o
263b3o76bo$392b2obobobobo2bo265bo74b3o11bo$395bobobobo319bo22bo13bobo$
144bo250bobob2o275b2o31bo11b3o20b2o13bo$143bobo250bo279b2o29b3o14bo31b
3o20b2o$143b2o546bo14bo16b2o31bo22b2o$181b2o226b2o280b3o12b2o$180bobo
217b2o7bo284bo$181bo218b2o5bobo283b2o$407b2o2$152bo533b2o6b2o$151bobo
532bo7b2o17b2o$151b2o531bobo26b2o$189b2o493b2o$188bobo$189bo207b2o157b
o$398bo157b3o$395b3o161bo218b2o$160bo234bo162bobo126bobo20b2o32b2o32bo
$159bobo396bobo125bob2o20bo20b2o11b2o22b2o3b2o4b3o$159b2o334bo11b2o50b
o124b3o24b3o18bo33bo2bo4bo6bo$197b2o295bobo10b2o174bo4b2o23bo15b3o34b
3o5bobo$196bobo287bo3b2o2bobo186b5obo17b2o20bo45b2o$197bo279b2o6bobo2b
o2b2ob2o189bo19bo58b2obo$477b2o6bobo3bobo189b2o3bo19b3o37b2o16bob2o$
486bob4o2bob2o76b2o107bobo3bo20bo38bo$168bo319bo3bobob2o76b2o108bo3b2o
56b3o$167bobo317bo3bobo252bo$167b2o170bo146bo3bobo171b2o$205b2o130b3o
146b2o3bo172b2o$204bobo120b2o7bo217b2o$205bo121b2o7b2o10b2o203bobo77bo
$348bo204bo79b3o$346bobo150b2o51b2o7b2o73bo32b2o$176bo169b2o10bo140b2o
60b2o72b2o10bo21b2o$175bobo180b3o153b2o130bobo16b2o$175b2o184bo151bo2b
o52b2obo73bobo16b2o$213b2o145b2o152b2obo51b2ob3o49bo20b2ob3o55b2o$212b
obo160b2o90b2o48bo57bo48b3o24bo54b2o$213bo161bo91b2o48b2o50b2ob3o52bo
17b2ob3o6bo13b2o27b2o$372b2obo126b2o64bo2b2o53b2o17b2obo6b3o13b2o27b2o
$371bo2bo128bo63bobo84bo$184bo187b2o126b3o46bo16bobob2obo80b2o11bo$
183bobo171b2o129b2o10bo48b3o15bo2bob2o55b2o36b3o32b2o$183b2o147b2o23b
2o129bobo61bo17bo57bo2bo38bo24b2o5b2o$221b2o90bobobobo13bo156bo60b2o
16b2o58b2o38b2o24b2o$220bobo89bob2ob2obo9b3o157b2o74bobo2b2o111b2o$
221bo90bo3bo3bo9bo235b2o2bo2bo110bo$313b2obo3b2o22b2o3bo221b2o108b2obo
$315bo28bo3bobo329bo2bo$192bo122bobo27bo3bobo329b2o$191bobo122b2o28bo
3bobob2o127bo83b2o97b2o$191b2o151bob4o2bob2o127b3o81bo73b2o23b2o$229b
2o112bobo3bobo134bo78bobo74bo$228bobo112bobo2bo2b2ob2o129bobo77b2o72b
3o$229bo114bo3b2o2bobo66bo11b2o50bobo151bo$352bobo10b2o53bobo10b2o51bo
166b2o3bo$353bo11b2o45bo3b2o2bobo230bo3bobo$200bo210bobo2bo2b2ob2o230b
o3bobo$199bobo209bobo3bobo144b2o89bo3bobob2o$199b2o211bob4o2bob2o121b
2o17bo88bob4o2bob2o$237b2o175bo3bobob2o77b2o43bo18b3o84bobo3bobo$236bo
bo113bo11b2o30b2o15bo3bobo81b2o40b3o21bo84bobo2bo2b2ob2o$237bo113bobo
10b2o31bo14bo3bobo124bo109bo3b2o2bobo$343bo3b2o2bobo43bobo12b2o3bo243b
obo10b2o$329bo12bobo2bo2b2ob2o43b2o2b2o158bo99bo11b2o$208bo120b3o10bob
o3bobo51b2o77b2o79b3o$207bobo122bo10bob4o2bob2o125bobo82bo$207b2o122b
2o12bo3bobob2o70b2o53bo67b2o14b2o10bo$245b2o66bo30bo3bobo74b2o52b2o7b
2o57bobo25bobo$244bobo64b3o29bo3bobo90b2o46b2o57bo27bobo$245bo55b2o7bo
32b2o3bo90bo2bo103b2o5bo20b2ob3o$301b2o7b2o10b2o116b2obo52b2obo53b3o
24bo$322bo66b2o52bo52b2ob3o54bo17b2ob3o6bo$216bo103bobo67bo52b2o57bo
52b2o17b2obo6b3o$215bobo102b2o34b2o32bobo35b2o66b2ob3o81bo$215b2o139b
2o33b2o36bo65bo2b2o83b2o11bo$253b2o116b2o53b3o65bobo61b2o36b3o$252bobo
115bo2bo40b2o10bo49bo16bobob2obo56bo2bo38bo$253bo117b2obo39bobo59b3o
15bo2bob2o57b2o38b2o$374bo41bo62bo17bo115b2o$374b2o16b2o22b2o60b2o16b
2o115bo$224bo134b2o32bo99bobo2b2o110b2obo$223bobo134bo29b3o15b2o83b2o
2bo2bo108bo2bo$223b2o106b2o24b3o30bo17bobo87b2o110b2o$306b2o23b2o11b2o
11bo52bo184b2o$287bobobobo13bo36bo48b2o15b2o5b2o151b2o23b2o$286bob2ob
2obo9b3o38b3o44bobo18b2obobo75b2o75bo$286bo3bo3bo9bo42bo44bo21bobo77bo
73b3o$287b2obo3b2o95b2o21bo2bo74bobo73bo$232bo56bo37b2o86bobo74b2o88b
2o3bo$231bobo55bobo35bo88bo165bo3bobo$231b2o57b2o36b3o252bo3bobo$330bo
9bo11b2o230bo3bobob2o$339bobo10b2o228bob4o2bob2o$331bo3b2o2bobo149b2o
88bobo3bobo$322b2o6bobo2bo2b2ob2o88b2o39b2o17bo89bobo2bo2b2ob2o$322b2o
6bobo3bobo92b2o40bo18b3o87bo3b2o2bobo$240bo90bob4o2bob2o127b3o21bo95bo
bo10b2o$239bobo91bo3bobob2o127bo120bo11b2o$239b2o91bo3bobo$331bo3bobo
73b2o76bo$331b2o3bo73bobo76b3o$410bo81bo$409b2o7b2o55b2o14b2o10bo$418b
2o54bobo25bobo$344b2o128bo27bobo$344b2o80b2obo43b2o5bo20b2ob3o$359b2o
65b2ob3o48b3o24bo$358bo2bo70bo50bo17b2ob3o6bo$359b2obo63b2ob3o50b2o17b
2obo6b3o$312b2o48bo62bo2b2o80bo$252b2o4b2o52b2o48b2o60bobo83b2o11bo$
252b2o5bo87b2o57bo16bobob2obo54b2o36b3o$256b3o4bob2o81bo57b3o15bo2bob
2o53bo2bo38bo$256bo4b3ob2o23b2o53b3o61bo17bo57b2o38b2o$260bo29bo42b2o
10bo62b2o16b2o112b2o$261b3ob2o21bobo42bobo87bobo2b2o110bo$263bobo22b2o
45bo87b2o2bo2bo106b2obo$263bobo8b2o59b2o91b2o106bo2bo$264bo4b2o3b2o
261b2o$269b2o251b2o$424b2o71b2o23b2o$424bo73bo$216b2o50b2o152bobo70b3o
$217bo51bo5b2o145b2o71bo$215bo50b3o6b2o232b2o3bo$215b5o14b2o30bo242bo
3bobo$220bo13bo275bo3bobo$217b3o12bobo98bo177bo3bobob2o$216bo15b2o99b
3o85b2o86bob4o2bob2o$216b4o116bo65b2o17bo86bobo3bobo$214b2o3bo3b2o110b
obo65bo18b3o83bobo2bo2b2ob2o$213bo2b3o4b2o110bobo62b3o21bo84bo3b2o2bob
o$213b2obo119bo63bo116bobo10b2o$216bo301bo11b2o$216b2o3$224b2o125b2o
52b2o$225bo125b2o51bobo$222b3o179bo$222bo180b2o6bo$411b3o$331b2o81bo$
330bobo80b2o10bo$330bo93bobo$329b2o7b2o84bobo$338b2o62bo20b2ob3o$402b
3o24bo$346b2obo55bo17b2ob3o6bo$346b2ob3o52b2o17b2obo6b3o$352bo79bo$
346b2ob3o80b2o11bo$345bo2b2o57b2o36b3o$344bobo59bo2bo38bo$326bo16bobob
2obo56b2o38b2o$326b3o15bo2bob2o111b2o$329bo17bo114bo$328b2o16b2o111b2o
bo$343bobo2b2o108bo2bo$343b2o2bo2bo108b2o$348b2o94b2o$419b2o23b2o$420b
o$344b2o71b3o$344bo72bo$342bobo86b2o3bo$342b2o87bo3bobo$432bo3bobo$
433bo3bobob2o$431bob4o2bob2o$430bobo3bobo$341b2o87bobo2bo2b2ob2o$322b
2o17bo89bo3b2o2bobo$323bo18b3o94bobo10b2o$320b3o21bo95bo11b2o$320bo5$
325b2o$324bobo$324bo$323b2o19$319bo$317b3o$316bo$316b2o6$324bo$322b3o$
321bo11bo$306bo14b2o8b3o$305bobo22bo$306bo23b2o11bo$343b3o$346bo$345b
2o$308b2o50b2o$307bobo50bo$307bo49b2obo$306b2o48bo2bo$310b2o45b2o$311b
o30b2o$308b3o6b2o23b2o$308bo9bo$315b3o$315bo$329b2o3bo$329bo3bobo$330b
o3bobo$331bo3bobob2o$329bob4o2bob2o$328bobo3bobo$328bobo2bo2b2ob2o$
329bo3b2o2bobo$337bobo10b2o$338bo11b2o!
#C [[ AUTOSTART THUMBNAIL THUMBSIZE 2 PAUSE 3 X 369 Y -253 ZOOM 0.6 GPS 1 THEME 4 ]]
#C [[ T 1 PAUSE 2 ZOOM 8 GPS 60 ]]
#C [[ T 130 X 390 Y -280 ZOOM 12 ]] glider to Snark
#C [[ T 210 X 409 Y -264 ZOOM 10 ]] glider to receiver
#C [[ T 440 X 413 Y -220 ZOOM 8 ]] Herschel to turn
#C [[ T 800 X 346 Y -212 ZOOM 3 ANGLE 90 ]] Herschel to G4
#C [[ T 1050 X 363 Y -151 ZOOM 14 ANGLE 45 ]] to G4-loaflector
#C [[ T 1112 X 346 Y -134 ZOOM 12 ANGLE 180 ]] to G13 receiver
#C [[ T 1470 X 358 Y -72 ]] to Herschel
#C [[ T 1570 X 317 Y -70 ZOOM 10 ]] to LWSS
#C [[ T 1620 X 301 Y -83 ]] to glider
#C [[ T 1750 X 272 Y -86 ZOOM 8 ]] to Herschel
#C [[ T 1790 X 272 Y -86 ANGLE 270 ]] to Herschel turn
#C [[ T 1955 X 275 Y -25 ZOOM 3 ]] to MWSS
#C [[ T 2105 X 202 Y -24 ZOOM 6 ]] to HWSS
#C [[ T 2836 X 273 Y 54 ZOOM 3 ]] to glider
#C [[ T 4000 X 24 Y 140 ZOOM 1.75 ]] to lots of gliders
#C [[ T 4360 X -113 Y 113 ZOOM 1.25 ]] same gliders
#C [[ T 4828 X -174 Y 135 ZOOM 5 ]] to switch engine
#C [[ T 5295 X -189 Y 119 ZOOM 3 ]] to faster switch engine
#C [[ T 7855 X -419 Y -100 ZOOM 8 STEP 8 ]] to glider
#C [[ T 8500 ZOOM 3 ]]
#C [[ T 10000 X 0 Y 0 ZOOM 0.5 STOP 10000 ]]

User avatar
dvgrn
Moderator
Posts: 10670
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Screen Grab or export Script for each generation

Post by dvgrn » November 25th, 2016, 11:49 am

I tried modifying lifeviewer.lua to export frames to PNG files as it drew them, and then took the results to a random online video-making site to see what I could get out. When I tried 225 frames at 200x112, that was way too much for the gifmaker.me server, so I just got back an error... but shorter animations worked out just fine:
half-size animated gif from modified lifeviewer.lua
half-size animated gif from modified lifeviewer.lua
LifeViewer_animation_50pct.gif (821.32 KiB) Viewed 12723 times
Here are the lines I added to lifeviewer.lua:

New line 274 (end of section):

Code: Select all

local pngcount = 10000
New line 596-597 (after 'ov("update")', before 'end'):

Code: Select all

    ov("save 0 0 0 0 C:/pngs/LifeViewer"..pngcount..".png")
    pngcount=pngcount+1
So PNG exports are looking pretty workable -- it will be possible to get nice movie versions of anything that lifeviewer.lua can do. And of course you can string together multiple short lifeviewer.lua movies if you want to, outside of Golly. It just remains to be seen how much of LifeViewer functionality will be imported into lifeviewer.lua, and how soon...!
Attachments
full size animated gif from modified lifeviewer.lua
full size animated gif from modified lifeviewer.lua
LifeViewer_animation.gif (1.18 MiB) Viewed 12723 times

larrylazzardo
Posts: 10
Joined: September 10th, 2015, 6:39 pm

Re: Screen Grab or export Script for each generation

Post by larrylazzardo » November 26th, 2016, 1:04 am

Andrew wrote:
larrylazzardo wrote:I am working on a Macbook.
Have you tried using the recording function in QuickTime Player? See here for details:

http://osxdaily.com/2010/11/16/screen-recorder-mac/
Yo ya I tried that indeed. ! But again, the recorder actually records the fluctuating speed. I want it to be smooth. Thanks tho!

larrylazzardo
Posts: 10
Joined: September 10th, 2015, 6:39 pm

Re: Screen Grab or export Script for each generation

Post by larrylazzardo » November 26th, 2016, 1:26 am

Eventually it might not matter too much if LifeViewer runs smoothly or not. If we're using a modified lifeviewer.lua to export frames from an animation, then the computer can take as long as it likes to render each frame, and it will still come out smooth when it's compiled into a video.
Totally. !! I don't have the scripting skills but this is all very educational for me. Those animations look cool.

But ya, ultimately I would like to figure a way to export files for each generation of Golly as close to how it appears on the screen as possible. Lifeviewer doesn't look much like how it appears on my screen, even imagining the zooms etc. I wonder is there a difference between Mac and PC in visual appearance?

I'll post more of my sketches as they come together.

cheers,
eli

User avatar
dvgrn
Moderator
Posts: 10670
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Screen Grab or export Script for each generation

Post by dvgrn » November 26th, 2016, 11:22 am

larrylazzardo wrote:Lifeviewer doesn't look much like how it appears on my screen, even imagining the zooms etc. I wonder is there a difference between Mac and PC in visual appearance?
Not so much -- the differences mostly in the buttons and other GUI controls. You can see sample screenshots on Golly's home page.

That animated GIF was just a random sample. The lifeviewer.lua script doesn't produce output that looks like Golly because it's supposed to look like LifeViewer -- but it's just as easy to export cell views with Golly's standard theme, like so:
Time-reversed sample pattern with Golly's standard two-state theme
Time-reversed sample pattern with Golly's standard two-state theme
golly_style.gif (376.07 KiB) Viewed 12674 times
Here's the script that I used to create that animation:

Code: Select all

-- Overlay exporter for Golly (work in progress)

local g = golly()
local ov = g.overlay

local gp = require "gplus"
local op = require "oplus"

local a = require "gplus.strict"

local viewwd, viewht = g.getview(g.getlayer())
ov("create "..viewwd.." "..viewht)

local i = 131
while i > 99 do
    ov("cellview -16 -16 144 144")
    ov("celloption grid 1")
    ov("camera zoom 4")
    ov("updatecells")
    ov("drawcells")
    ov("update")
    -- ov("copy 0 0 0 0 all")
    -- ov("paste 0 0 all")
    ov("save 0 0 0 0 C:/pngs/LifeViewer"..i..".png")
    i = i - 1
    g.run(1)
end

ov("delete")
Of course there are some magic numbers in there, especially the "-16 -16 144 144" and the "zoom 4", specific to the particular pattern I started with, which was

Code: Select all

#CXRLE Pos=12,15
x = 98, y = 85, rule = B3/S23
57b5o6b5o$57b5o6b5o$57b5o6b5o$11b10o36b5o6b5o$8b16o33b5o6b5o$6b20o31b
5o6b5o$5b8o6b7o31b5o6b5o$4b7o10b5o31b5o6b5o$3b7o13b3o31b5o6b5o$3b6o48b
5o6b5o$2b6o49b5o6b5o$2b5o30b9o11b5o6b5o3b6o10b6o$b6o28b13o9b5o6b5o3b6o
10b5o$b6o27b16o7b5o6b5o4b5o10b5o$b5o27b7o4b7o6b5o6b5o4b6o8b6o$b5o26b6o
7b6o6b5o6b5o4b6o8b5o$6o25b6o9b6o5b5o6b5o5b5o8b5o$6o7b13o5b6o9b6o5b5o6b
5o5b6o6b6o$6o7b13o5b5o11b5o5b5o6b5o6b5o6b5o$6o7b13o5b5o11b6o4b5o6b5o6b
6o4b6o$6o15b5o4b6o11b6o4b5o6b5o6b6o4b6o$b5o15b5o4b6o11b6o4b5o6b5o7b5o
4b5o$b6o14b5o4b6o11b6o4b5o6b5o7b6o2b6o$b6o14b5o4b6o11b6o4b5o6b5o7b6o2b
5o$b6o14b5o4b6o11b5o5b5o6b5o8b5o2b5o$2b6o13b5o5b5o11b5o5b5o6b5o8b12o$
2b7o12b5o5b6o9b6o5b5o6b5o9b10o$3b7o11b5o5b6o9b6o5b5o6b5o9b10o$4b7o10b
5o6b6o7b6o6b5o6b5o9b10o$5b8o6b7o6b7o4b7o7b5o6b5o10b8o$6b20o7b16o8b5o6b
5o10b8o$8b16o10b14o9b5o6b5o10b8o$11b10o16b9o11b5o6b5o11b6o$84b6o$84b5o
$83b6o$83b6o$83b5o$82b6o$82b5o$81b6o4$64b5o$64b5o$64b5o$64b5o$64b5o$
27b5o32b5o$27b5o32b5o$27b5o32b5o$27b5o32b5o$27b5o32b5o$27b5o32b5o$10b
8o5b15ob6o10b6o3b5o11b9o$8b12o3b15ob6o10b5o4b5o9b13o$7b14o2b15o2b5o10b
5o4b5o8b15o$6b6o4b5o6b5o8b6o8b6o4b5o7b6o4b7o$6b5o7b3o6b5o8b6o8b5o5b5o
6b6o7b5o$6b5o16b5o9b5o8b5o5b5o6b5o8b6o$6b5o16b5o9b6o6b6o5b5o5b5o10b5o$
6b6o15b5o10b5o6b5o6b5o5b5o10b5o$6b7o14b5o10b6o4b6o6b5o5b5o10b5o$7b9o
11b5o10b6o4b6o6b5o5b20o$8b10o9b5o11b5o4b5o7b5o4b21o$10b10o7b5o11b6o2b
6o7b5o4b21o$13b8o6b5o11b6o2b5o8b5o5b5o$15b6o6b5o12b5o2b5o8b5o5b5o$16b
6o5b5o12b12o8b5o5b5o$16b6o5b5o13b10o9b5o5b5o$16b6o5b5o13b10o9b5o5b6o$
5b3o8b6o5b6o12b10o9b5o6b6o9b3o$5b6o4b6o6b6o3b2o8b8o10b5o7b7o5b6o$5b15o
8b10o8b8o10b5o7b17o$6b13o9b10o8b8o10b5o9b14o$8b9o13b7o10b6o11b5o11b9o$
47b6o$47b5o$46b6o$46b6o$46b5o$45b6o$45b5o$44b6o!
But it won't take a lot of changes to the script to generalize it to export N generations of whatever pattern is currently in the Golly universe. Would that be helpful? Again, the only version of Golly that will run this script at the moment is a beta version, Golly 2.9b1.

larrylazzardo
Posts: 10
Joined: September 10th, 2015, 6:39 pm

Re: Screen Grab or export Script for each generation

Post by larrylazzardo » November 26th, 2016, 8:40 pm

But it won't take a lot of changes to the script to generalize it to export N generations of whatever pattern is currently in the Golly universe. Would that be helpful? Again, the only version of Golly that will run this script at the moment is a beta version, Golly 2.9b1.
I wouldn't mind trying it out. I am not sure where to find Beta versions of Golly... ?

User avatar
dvgrn
Moderator
Posts: 10670
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Screen Grab or export Script for each generation

Post by dvgrn » November 26th, 2016, 9:36 pm

larrylazzardo wrote:
But it won't take a lot of changes to the script to generalize it to export N generations of whatever pattern is currently in the Golly universe. Would that be helpful? Again, the only version of Golly that will run this script at the moment is a beta version, Golly 2.9b1.
I wouldn't mind trying it out. I am not sure where to find Beta versions of Golly... ?
Sorry, should have linked it again. Here's a download link for the beta. Definitely still a work in progress at the moment, but it does allow the above Lua script to work.

EDIT: Now we're up to Golly 3.0 beta 1.

Post Reply