Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 22nd October 2009, 02:14   #1  |  Link
Archimedes
Registered User
 
Join Date: Apr 2005
Posts: 213
Fritz Photo

In 2007 i was thinking about a tool based on AviSynth for batch processing still images. The basic idea was, loading images, filtering with AviSynth scripts (e. g. resizing and sharpening) and saving the images. A very basic idea.

The result was Fritz Photo.

In the meanwhile there are a lot of improvements. May be someone find it usefull.

The program supports two languages (german and english) and should be self-explanatory. However, here are some very basic instructions.


Requirements:

- AviSynth+
- Fritz Photo 2020.07.08 (templates from: 07/08/2020)

If you add the following user environment variables, you are able to read and write more graphic formats (see Immaavs for more details):
- MAGICK_HOME = <Fritz Photo program directory>\dll\ImageMagick
- MAGICK_CODER_MODULE_PATH = <Fritz Photo program directory>\dll\ImageMagick


Processing still images are divided into five steps.


1. Images

You can read BMP, JPG, PNG, PPM, TGA und TIF images with ImageSource as start script. There are two start scripts at the moment: ImageSource and ImmaRead.


2. Crop

In front of any filtering you can rotate and crop an image.


3. AviSynth Scripts

With a double click on a template you load that template to the job list (removing a template from the job list can also be done with a double click). Drag and drop operations are also supported. All scripts have nearly the same structure. On the top of each script you will find the necessary parameters. You can change the parameters directly in the scripts or you can use the script inspector. With "Add..." you can load templates (scripts) outside of the template directory. With "New" you can delete the entries in the job list and start a new selection. "Reload" read the selected template again, so you can start with the default values.


4. Preview

By pressing "Refresh" you start the preview. With the cursor keys you can switch between the before and after image. You will see the image, that is selected on the page "Images". If no image is selected, you will see the first image in the list box. If you have selected a filter in the job list, you can see a before and after image of exactly this filter. If no filter is selected, then you will see the source image (loaded with the start script) and the target image (all filters are applied) as preview. With a right mouse click you can refresh each preview window separately. "Synchronize Preview Windows" means, that the before and after window will show exactly the same area of the image (if possible).


5. Settings

File Size means, that you can define a maximum file size. Fritz Photo will then calculate the optimal jpg quality for the given file size. With "Find" and "Replace" you can change the file names. You can use regular expressions to do that. If "Suffix" is activated, output file names will have the following pattern: <Original name>_<Width>x<Height>.<ext>. If "Suffix" is deactivated, the output file names will be the same as the input file names. If no directory is given, the program writes the images to the same directory where the sources are. All start settings can be changed in the program ini file.


How do i create my own Fritz Photo script?

A Fritz Photo script is nothing else than a structured AviSynth script with additional comments. These comments are the properties for the script inspector. Each script support one of the following color formats: (double sized) YV12, YV24 or RGB32. Look at the Rotate script below for further explanation.

Code:
# ==============================================================================
# http://avisynth.org.ru/rotate/rotate.html
# ==============================================================================
angle  = 0.0
color  = 0
width  = 0
height = 0
# ==============================================================================
# angle  = True, False, Beginner, Rotation angle in degrees clock wise | float
# color  = True, False, Intermediate, Ellipsis, ColorDialog, Background color of part of image | int
# width  = True, False, Intermediate, Width of the destination output image | int
# height = True, False, Intermediate, Height of the destination output image | int
# ==============================================================================

LoadPlugin("plugins\Rotate\Rotate.dll")

isYV12() ? YV12ToYV24() : isYV24() ? NOP() : NOP()

Rotate(angle=angle, color=color, width=width, height=height)
A Fritz Photo script contains of 4 sections.

- Information about the plugin
- Parameter
- Script inspector properties
- The script itself

The first section contains information about the plugin, mostly it is a link to the AviSynth homepage with a description of the plugin. You can add as many lines, as you want.

The second section contains the parameter used in the script. This parameter will also be shown in the script inspector in the GUI.

The third section contains the settings for the script inspector, with the meaning in the following order: "Visible, Read only, Level, Hint for the parameter | Hint for the value". You can also define a picklist with predefined values (see SSSharp.avs for an example). If you don't define script inspector properties for a parameter, the parameter will be treated as "True, False, Beginner".

The fourth section is the script itself. It begins with a LoadPlugin section, followed by the Import section. The next line checks, wether the input clip is one of the following color formats: (double sized) YV12, YV24 or RGB32. All scripts have a similar line to check the incoming color format of the image. If a conversion is necessary, it will be done. In our example, we only accepted the YV24 and RGB32 color format for the Rotate plugin. So nothing is to do, if the image is already in the YV24 or RGB32 color format.

Thats all.

If you need a template for a new YV12 plugin, look in the template directory and take a template which you can use as a working base. For example take the TNLMeans.avs script as a working base for a new YV12 plugin. If you need a RGB32 only script, take a look at RGBAdjust.avs.

Last edited by Archimedes; 31st January 2022 at 15:40.
Archimedes is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.