CLI automation/project format

179 views
Skip to first unread message

Joel Cretan

unread,
Jun 10, 2024, 2:55:20 AM6/10/24
to PTGui Support
Hello,

I'm very impressed with the PTGui demo version, and if the interface that I need exists, I will be happy to buy the Pro version. I know you can generate a new project on the command line with a set of images. What I would like to be able to do is do complex modifications to the project programmatically. So I'm wondering whether this is possible: given a project containing images, can I script the alignment and control point generation from the command line or some scripting interface? Is the PTS file documented in some way so I can dig into it to modify it using my own custom tools?

I have built up a workflow in Python to generate randomized art collages (not from panoramic photos) using pto_gen/pano_modify/nona/enblend/etc, with all the image placements, lens parameters, and control points assigned by my own software. This is doable with PTO files because they're just text. Messing around inside your binary files will be harder without documentation (I'm a reverse engineer and that would be way too much like work!). Does PTGui offer a CLI that will let me define all those parameters? (I have read FAQ 6.32 and 6.33 and those options aren't enough for what I want to do, but I appreciate that you have anticipated the collage use case!) 

Even after compiling enblend from source by digging up 10 year old OpenCL headers, somehow using the GPU in enblend is actually slower than the CPU. What took 4 hours in enblend took 30 seconds in PTGui. I would love to do this with PTGui instead if I can control it all the way.

Thank you!
Joel

PTGui Support

unread,
Jun 10, 2024, 3:04:54 AM6/10/24
to pt...@googlegroups.com
Hi Joel,

Actually the project file is JSON based. The trial version generates
encrypted files though, to prevent it from being used in a way that
would bypass the trial restrictions.

I have attached a project file from the licensed version.

Keep in mind that the file format is not documented and future changes
to PTGui may break your scripts. It's also technically no 100% json,
since the ordering of the sections do matter ("contenttype" should come
before "project"). This is so that PTGui can stream in the file instead
of parsing it entirely first.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com
> --
> You received this message because you are subscribed to the Google
> Groups "PTGui Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ptgui+un...@googlegroups.com
> <mailto:ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/37bf58aa-eb5c-4c1d-8f76-2128c4b399f8n%40googlegroups.com <https://groups.google.com/d/msgid/ptgui/37bf58aa-eb5c-4c1d-8f76-2128c4b399f8n%40googlegroups.com?utm_medium=email&utm_source=footer>.
IMG_1536 Panorama (5).pts

Joel Cretan

unread,
Jun 10, 2024, 12:47:05 PM6/10/24
to PTGui Support
Thank you Joost, this format looks very workable, probably even easier than PTO files. I'm looking forward to getting the full version to dig in. Not only is PTGui orders of magnitude faster with the GPU, the blending is even better than enblend. Thanks for your prompt reply!

Nico Höllerich

unread,
Jun 11, 2024, 5:34:21 PM6/11/24
to PTGui Support
Hi Joel,

I've already written a script that generates a project from a set of images. I managed to add custom masks (to mask out clipped highlights), create exposure groups, change output parameters, and load custom lens profiles for third party lenses. It works really great and PTGui gives a usable error message if there is something wrong with the json file.

If you want to convert your old .pto files to .pts I have written an extension for Hugin that allows you to export PTGui 10 project files. Get in contact, if you are interested (I can give you the Windows binaries or source code - however it's quite a pain to build hugin from source)

Joel Cretan

unread,
Jun 15, 2024, 5:18:55 PM6/15/24
to PTGui Support
Nico: thanks for the offer! I would be happy to see your script if you can post a link to it. I don't think I'll need the custom Hugin binary, just the script to work with PTS files would be great!

Joost: I have had some success already modifying PTS files and rendering with PTGui Pro. I was able to easily repurpose my scripts to generate a layout of images, control points, set the projection, etc. I have successfully generated and stitched PTS files with 720 images. Now I am trying to generate one with 1200 images. The PTS file comes out to about 4.5 MB. I get this error in PTGui: "Could not read this PTGui project file:Invalid value". This error is less helpful than some others I've gotten so far that specify a line number. Is this related to the file size? Is there a maximum? The JSON still appears valid.

Thanks!

Joel Cretan

unread,
Jun 15, 2024, 5:36:28 PM6/15/24
to PTGui Support
PS: a 700-image panorama creates a 3.6GB TIFF file. Much larger would require BIGTIFF, I think. Is the error related to this? The error occurs during project load, not during stitching.

PTGui Support

unread,
Jun 16, 2024, 4:25:20 PM6/16/24
to pt...@googlegroups.com

Nico Höllerich

unread,
Jun 21, 2024, 2:16:21 PM6/21/24
to PTGui Support
Hi Joel,

did you get the mail with the code? I had some issues with my mail program.

Reply all
Reply to author
Forward
0 new messages