Port POV tools to Windows

Any programming minds know how to get POV tools working in a shell on Windows?
I’m pretty sure WSL needs to be installed, and then a few Linux commands wrapped, but it’s gone beyond what i can fathom without hands on…and I feel lazy about it :frowning:
This is the conversation thus far:

Anyways back in the day you wrote you are not sure how this POV tools would work on windows. 
I hoped that maybe like you found a way for the Font Renaming, that there would be now a way to make it work for windows too.
---
If you have the linux subset tools or whatever it is to have Renaming tool work in command line, the script in EZPOV might work?
---
That's what i was hoping
---
https://www.dropbox.com/s/jiyajgixlre3my5/EZ-POV2.zip?dl=0
---
i think with the renaming tool you had a .bat file which would then execute the bash stuff
---
yeah you could copy the bat to the unzipped EZPOV2 folder, and edit it to replace convert.sh to create_POV_data_files ...?
---
i'll try 😃 what could possibly go wrong
---
do i already need a png i want to transform? or could i run the code without having actually stuff to convert
---
need a source file
---
same folder as the create_POV_data_files?
need to read the manual

no dice
if i change create_POV_data_files to Makefile (which seems to be the job of create_POV_data_files (by "make") this is what i get. even more unknown commands:
https://pastebin.com/jwJVLv0Y

but it creates 3 empty files 😃
---
maybe this helps?
https://devblogs.microsoft.com/commandline/integrate-linux-commands-into-windows-with-powershell-and-the-windows-subsystem-for-linux/
---
wsl is installed but i guess i  would have to create a command for every linux command that is missing
---
just make so far
---
so i installed make and then it did not found g++ command. so i installed it. now i get this:
https://pastebin.com/F4RD3iHh
1 Like

Thanks @NoSloppy for creating this real quick.
I am the guy trying to get this to work.

I got Win10 with the Ubuntu “App”.
WSL is installed and I was able to install “make” via WSL.
Afterwards I got a new error that the g++ command wasn’t found so I also installed that with the following guide:

Executing the make command now lead to the pastebin:

G++ seems to be on version 9 if that helps.
I am open for more ideas.
Cheers!

Should be fixed on master now.

2 Likes

Thanks! I’ll try it out later today and keep you posted.

We are getting closer.
It was calculating something but the result was that pnmscale, pnmtopng and pngtopnm where not found.
See here:

So i went into WSL and installed it (via net-something).
I used the following file as a test (provided by @NoSloppy )


test.png

Now it finishes the script and I get the following files:

  • pgmtorle (additonal to pgmtorle.cc that was already there)
  • pnmtorle (additonal to pnmtorle.cc that was already there)
  • pnmwindschieldwiper (additonal to pnmwindschieldwiper.cc that was already there)
  • test_FC_POV_data.h (FC_POV_data.h - Pastebin.com)
  • test_SC_POV_data.h (SC_POV_data.h - Pastebin.com)
  • test_preview.png

Unfortunately test_preview.png is all black.

Now I am not sure, if at least the .h-files are as they should be. Any Ideas?

I am going to try to use a transparent png next, but not sure that this would give better results.

Edit: Unfortunately that wasn’t any better.


test-transparent.png

Here is the succesful run of the script in powershell:

Hi @profezzorn,
do you see anything in the pastebins that would explain the rendered preview image to be pitch black?
Or do the .h-files look reasonable?
I appreciate the help.

Looks like it fails at the first step for some reason:

usage:  pngtopnm [-verbose] [-alpha | -mix] [-background color] ...
             ... [-gamma value] [-text file] [-time] [pngfile]

This means that pngtopnm failed. Maybe there is more than one png file in your directory?

And this confirms it:

 scale = 201050263905634965063595248128807002721845661138944.000000 

The scale wouldn’t be so insanely large if the input image wasn’t empty.

Unfortunately, no. I only put in the test image in there.
Are there any hidden requirements to the image?
Is it possible to debug that further?

If it’s printing out the “usage”, then it’s not the image itself that’s the problem, but the command line. Try using the name of the image instead of *.png.

1 Like

Success!
I tried different variations of your suggestion. What helped was that I changed:

preview.png: pnmwindshieldwiper *.png
	pngtopnm *.png | ./pnmwindshieldwiper | pnmscale -height 144 | pnmtopng > $(basename $(OUTPUT))_preview.png

To:

preview.png: pnmwindshieldwiper *.png
	pngtopnm $(basename $(OUTPUT)).png | ./pnmwindshieldwiper | pnmscale -height 144 | pnmtopng > $(basename $(OUTPUT))_preview.png

With this, the script at least stays dynamic without having it to change it everytime.
Any ideas though why this is an issue at that particular spot?

Using *.png relies on there being only one png file in the directory, but that isn’t true anymore once the preview is created. It’s even possible that an empty preview file gets created before it scans for *.png. Not sure if that’s what’s causing your problem since I don’t know what else is in that directory.

This is my “POV” directory:

  • create_POV_data_files
  • EZ-POV.bat
start powershell -noexit -command "bash create_POV_data_files"
  • Makefile
  • pgmtorle.cc
  • pnmtorle.cc
  • pnmwindshieldwiper.cc
  • test.png

I believe you to be correct with the assumption about the preview.png messing this up, being already created.

Thanks to @NoSloppy and @profezzorn I was able to get the POV tools to work on my Windows 10 machine.
To help prevent anyone else having to go through this struggle from scratch, is here the guide:

"How to port POV tools to Windows 10"

Requirements:

  • Windows 10
  • “Windows Subsystem for Linux”
    • type “Turn Windows features on or off” into the windows search
    • scroll down and enable it

Steps:

  • get the Ubuntu App in the Microsoft Store (required for “bash” and other commands)
  • get the EZ-POV tool (Link to @NoSloppy Files will follow when he created a github for it)
  • extract the contents into a folder of your choosing
  • this should include
    • create_POV_data_files
    • Makefile
    • pgmtorle.cc
    • pnmtorle.cc
    • pnmwindshieldwiper.cc
  • create a textfile (e.g. EZ-POV.txt) in that folder
    • open it and put this line into it
      • start powershell -noexit -command "bash create_POV_data_files"
    • rename the file into a .bat-file (e.g. EZ-POV.bat)
    • this will be your executable file to start the script
    • this is a nifty trick courtesy of @NoSloppy used in his font-renaming tool
  • get a .png-file you want to convert and also place it in that folder (you can take the star wars logo mentioned in this thread)
  • if you were to execute the .bat-file it would now fail because of missing commands
  • type “WSL” into the windows search and click that cheeky penguin
    image
    • this will open a WSL command line prompt
  • type “make” into the command line and press Enter
    • if you don’t already have it installed, the console will give you a hint on how to do it. Follow the instructions.
  • you will also need to install "g++"
    • to do that follow steps 4-6 in this manual
  • type any of the three “pngtopnm”, “pnmscale” or "pnmtopng"
    • you should get a prompt to install “netpbm”. Follow the instructions.
  • double-click your .bat-file
    • if everything was done correctly, powershell should open and execute the scripts.
    • you should get two .h-files and a preview image

Hope that helps.
Cheers

Edit 2022-01-15:

  • removed the dropbox link to the EZ POV Tool, because a github link will replace it
  • added more specifics for the WSL command line prompt
2 Likes

Awesome! TIme for long exposure pics or video!

Therefore I would still need to know, how to implement it.
And I am also open for exposure settings.

Question: Is the height parameter in the Makefile relevant? It is currently set to 144 which looks like the amount of pixels a 1meter strip might have. But not sure if blade config will handle this and scale it accordingly.

Oh! You just add your *data.h file to the ProffieOS/styles folder, then edit the pov.h file in the same folder.
Replace the file name where it says #include "star_wars_logo_pov_data.h" with the *data.h file you generated.

Then you just use the style in a preset::

{ "Font", "tracks/track.wav",
   &style_pov, 
  "my_pov"},
2 Likes

Currently, the pov data is expected to be 144 pixels high. The blade code will re-scale it to the size of your actual blade. It could possibly be made slightly faster, sharper and smaller by setting the “height” parameter and adjusting the code accordingly.

As for exposure; I used a 2-second exposure when I did this a few years ago.
I also used a remote to trigger the camera, and a tripod. If you don’t have a remote, someone else could trigger the camera, but without a tripod or some stable place to put the camera it’s just going to turn into a blur.

1 Like

I should also point out that the neopixels upgrades in ProffieoOS 5 and 6 should make all of this work better than it ever has before, so I’ll be curious to see how it works out for people.

Here are some test shots with the basic star wars logo. Camera on a shelf and phone as remote.


3 seconds exposure.
line effect due to dark saber blade.


6.5 seconds exposure.
regular npxl blade.

Interesting that the orientation of the blade is relevant for text to be readable.

I think it tends to look better in a dim/dark room.
Or maybe just turn the exposure down on the camera?