# Scripts

A collection of useful scripts to automate stuff.

## Webp Conversion (general)

Webp is a new open image file format that supports lossy and lossless compression, as well as transparency.
This Powershell script will convert any jpg and png files in the same folder as the script into webp. Compression factor can be selected when running the script.

Uses the cwebp executable that needs to be in the same directory as the script.
More info on webp: [https://developers.google.com/speed/webp](https://developers.google.com/speed/webp)

## Navigator Image Conversion (JPG, Outdated)

Converts all images in the folder into JPG in two quality options, with input prompts for the compression for both and image size in % for the downscaled version.

Image names are also renamed in the navigators Zero-based & Zero-pad naming scheme, the order of which results from the original alphabetical order, but the actual file name is ignored (this is done so that Non-Zero-Based file names are automatically made Zero-Based).

The recommended JPG compression is at around 30.

The "Time" version of the script additionally adds a prompt for the first rendered hour and the number of pictures per hour, here input file names are required to be named in the scheme of HOUR_CAMERAID.fileext.

This has a dependency on [ImageMagick](https://imagemagick.org/script/download.php).

## Navigator Image Conversion (Webp, New)

Similar in syntax to the old navigator image conversion, but replaces the ImageMagick dependancy with the cwebp library (see Webp Conversion above) and uses the new quality level naming convention of "HQ/LQ" instead of the old "4K/2K".
Additionally now both high and low quality versions have a setting for image size and the size is now set as the desired image height in pixels rather than a percentage of the original file.

## Navigator Compass SVG Adjustment

Takes the number of cameras and the offset of north for camera 0 in degrees as input and changes the 'transform="rotate(xxx)"' of every compass SVG.
That way you only ever have to set one cameras angle, saving a bunch of time.
Also a good reference if you need to change any sort of text files programmatically.

## File Mover

Moves all files from all subdirectories of the location of the script to the location of the script.
Warning, be careful where you run this!