Log in

View Full Version : Fritz Photo


Pages : [1] 2 3 4

Archimedes
22nd October 2009, 02:14
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. :rolleyes:

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+ (https://github.com/AviSynth/AviSynthPlus/releases)
- Fritz Photo 2020.07.08 (templates from: 07/08/2020) (https://www.file-upload.net/download-14838592/Fritz_Photo_2020.07.08.zip.html)

If you add the following user environment variables, you are able to read and write more graphic formats (see Immaavs (http://forum.doom9.org/showthread.php?t=135928) 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.

# ==============================================================================
# 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.

buzzqw
22nd October 2009, 07:08
seems very insteresting :)

i use avisynth too for some image manipulation (basic denoise/sharpening)

thanks!

BHH

Leak
22nd October 2009, 09:08
seems very insteresting :)
Agreed. :)

i use avisynth too for some image manipulation (basic denoise/sharpening)
Don't forget NNEDI2 for resizing... ;)

patul
22nd October 2009, 13:41
Am a happy customer of it :D
Good job Archimedes...

Archimedes
22nd October 2009, 14:35
Thanks for your friendly words. :)

There is one problem with ImmaRead (if you used it as a start script) at the moment. ImmaRead doesn't free up memory after finishing. Better, you use it only for loading one picture or so. If you do a batch processing with a lot of pictures and ImmaRead is used as the start script, your memory will decrease after each conversion. Wilbert knows about the problem.

linyx
23rd October 2009, 01:47
This is going to be very useful, I have been "in the market" for an avisynth based photo editor for a while now.
:thanks::thanks:

Archimedes
23rd October 2009, 15:49
I've made a small cosmetic update. I have changed some captions and the batch processing page a little bit.

Normally, the program do not need any installation routine. The installation routine only copy the files to the selected progam directory. There will be no files copied to system32 folder or so on. No registry entries are needed. Fritz Photo itself is portable.

LaTo
23rd October 2009, 17:47
Seems very good, but it doesn't works on Win7 x64 for me... Someone can confirm?

eslave
24th October 2009, 02:32
Is there some special trick to downloading this (http://www.file-upload.net/download-1964236/FritzPhoto2009.10.23.exe.html)? I've tried with Opera 10/1750, Firefox 3.0.14 (ABP=Off), IE6, disabled my HOSTS file, etc. All I get is a 0-byte file. :confused:

It looks like a good idea and I'd like to give it a try.

Thanks in advance.

-eslave

Keiyakusha
24th October 2009, 03:42
Firefox 3.5.3, works fine.

Leak
24th October 2009, 11:16
Firefox 3.5.3, works fine.
Well, FF3.5.3 at least doesn't work here, I'm afraid:

http://www12.file-upload.net/data.php?id=1964236&name=FritzPhoto2009.10.23.exe

POST /data.php?id=1964236&name=FritzPhoto2009.10.23.exe HTTP/1.1
Host: www12.file-upload.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.file-upload.net/download-1964236/FritzPhoto2009.10.23.exe.html
Content-Type: application/x-www-form-urlencoded
Content-Length: 25
valid=69100856880&load6=+

HTTP/1.x 200 OK
Date: Sat, 24 Oct 2009 10:13:39 GMT
Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch15
X-Powered-By: PHP/5.2.0-8+etch15
Content-Disposition: attachment; filename="FritzPhoto2009.10.23.exe"
Content-Length: 0
Pragma: no-cache
Expires: 0
Keep-Alive: timeout=3
Connection: Keep-Alive
Content-Type: application/octet-stream

Note the reported content length of 0 bytes... :(

np: Tocotronic - Pure Vernunft Darf Niemals Siegen (Leak - Quer Durch Den Gemüsegarten Mix)

Keiyakusha
24th October 2009, 15:14
Oops, sorry. I just started download but didn't click "save" button. Yes, I have the same thing too. :(
It was fine few days ago...

eslave
24th October 2009, 21:49
Thanks for the confirmation. After failing again with my freshly updated Firefox I tried a few other machines as well, just to make sure I didn't have bad mojo in my browser or a blocked IP. At least now I don't have that disenfranchised feeling. :) Maybe the download bandwidth has been exhausted or the server ate the file, because I got the 0-byte data.php as well (several copies in fact), with the same headers Leak posted above.

-eslave

Who Am I ?
24th October 2009, 23:20
I cannot download it as well . gives exactly the same problem as reported

It indeed does seem pretty interesting , sehr gut !

buzzqw
25th October 2009, 08:11
well.. that's strange..

i was able to donwload it, but now .. isn't possible..

i will upload on my site tomorrow

BHH

Archimedes
25th October 2009, 15:15
There was a problem with uploading. I have uploaded the file again. Direct download link are now in the first post. Sorry for the circumstances.

DarkZell666
25th October 2009, 15:29
There was a problem with uploading. I have uploaded the file again. Direct download link are now in the first post. Sorry for the circumstances.

Link fixed indeed, thx !

Archimedes
25th October 2009, 17:25
Not mentioned it yet. The scripts takes care about the full chroma information of an image if a YV12 filter is used.

If you look inside the scripts, you will see, that an image is processed either in the RGB or YV12 color format (depending on the used AviSynth filter). If the YV12 color format is used, luma and chroma channels are filtered independently (because of the double sized YV12 image).

anyone23
25th October 2009, 18:02
Does this program support windows vista?

It looks like this on my vista sp2 pc:
http://www2.pic-upload.de/thumb/25.10.09/isybo5j9pk4r.png (http://www.pic-upload.de/view-3483985/FritzPhotoVista.png.html)

Nevertheless it works.:)

Edit: And is there an option so that Fritz Photo doesn't rename files?

Archimedes
26th October 2009, 11:33
Does this program support windows vista?
Normally it should work. Doesn't it?

And is there an option so that Fritz Photo doesn't rename files?
Use regular expressions to do that. The program always add "_<Width>x<Height>" as an extension to the file name. If AviSynth creates the output (this is the case for all graphic formats except JPG), it additionally added the string "_000000" to the file name. The default string "_000000$" in Find and the empty field in Replace will delete this AviSynth extension.

If you want to delete both extensions (Fritz Photo and AviSynth) do something like this (for all graphic formats except JPG):

Find: _\d{4}x\d{4}_000000$
Replace:

As JPG is created internally, you only have to remove the program extension:

Find: _\d{4}x\d{4}$
Replace:

But be carefull with that, because of the danger of overwriting the source files. If you want to delete the extensions completely and the output format is the same as the input format (source file name = target file name), select a different output directory, where all files are written to.

markanini
26th October 2009, 12:33
Fritzphoto is awesome!:D I use it all the time.
A request: Descreen filter for scans of printed media.

Archimedes
27th October 2009, 18:40
Another hint. If you create a directory "Fritz Photo" in the user application directory, you can copy all ini files (FritzPhoto.ini and subdirectory "etc") to this directory. Fritz Photo first try to read ini files from this directory (multi user support).

Archimedes
29th October 2009, 23:20
Added a font combo box on the AviSynth Scripts page. You have the choice between Courier, Courier New, Lucida Console und Raize (http://www.raize.com/devtools/tools/rzfont.asp) (included in the program directory).

buzzqw
30th October 2009, 08:29
little request

add a subtitle string to image :)

thanks :)

BHH

Archimedes
30th October 2009, 14:32
There is already a script "Subtitle" in the template directory.

buzzqw
30th October 2009, 14:46
doh!

i missed it
thanks!

BHH

Archimedes
9th November 2009, 15:14
And is there an option so that Fritz Photo doesn't rename files?
I've changed that behavior. Now, there is a check box, called "Suffix", where you can deactivate the extension "_<Width>x<Height>". So the input file name will be the same as the output file name. If a file exists, now a message dialog appears, where you must confirm to overwrite a file. You can also choose "Yes to All" and "No to All".

Archimedes
12th November 2009, 21:57
Added SmoothLevels (http://forum.doom9.org/showthread.php?t=137479) to the template directory.

http://img12.imageshack.us/img12/4532/10404360640x0480origina.jpg (http://img12.imageshack.us/i/10404360640x0480origina.jpg/)

http://img687.imageshack.us/img687/7015/10404360640x0480smoothl.jpg (http://img687.imageshack.us/i/10404360640x0480smoothl.jpg/)

Archimedes
24th November 2009, 00:42
AviSynth processes are running as threads now.

buzzqw
24th November 2009, 08:03
thanks Archimedes for these updates!

i have used your application several times, and it's freaking awesome!

maybe not tuned for newbie of avisynth... but it's very usefull!

BHH

Archimedes
24th November 2009, 16:48
AviSynth exceptions not shown anymore. I will upload a fixed version today.

Archimedes
25th November 2009, 23:10
AviSynth exception handling fixed.

Archimedes
10th December 2009, 15:29
Added JPC (JPEG 2000 Code Stream), PDF (Portable Document Format), EPS (Adobe Encapsulated PostScript) and PS (Adobe PostScript File) format. The memory leaks in ImmaRead are fixed now. Thanks again to Wilbert. The environment variable for the Immaavs plugin has changed:

MAGICK_HOME = <Fritz Photo program directory>\dll\ImageMagick

Updated the following plugins: FFmpegSource2, GScript, Immaavs and dfttest.

Wilbert
10th December 2009, 21:08
PDF (Portable Document Format), EPS (Adobe Encapsulated PostScript) and PS (Adobe PostScript File) format.
I think you will miss the necessary libraries for these formats, or did you try these formats? I have some time this weekend to look at it.

Archimedes
10th December 2009, 21:38
I've tested it before. I can read and write all formats (pdf, eps and ps) with the old libraries. As soon as the new libraries works, i will update it.

Archimedes
10th December 2009, 22:44
maybe not tuned for newbie of avisynth...
I already thinking about that. One step in that direction was the script "FritzPhotoResize" where the user is not confronted directly with a script. The user can set his parameters on the next page. But that is not exactly the way, i will go. I was thinking about an script inspector which (automatically) shows the parameters the same way as an object inspector in development tools. The user should have the choice between editing "source code" and the GUI alternative. A similar way like AvsP (http://avisynth.org/qwerpoi/) is also possible. There are many ways we can go. However, the output will always be the same. :rolleyes:

I'm also thinking about manually generating masks, where the user can define an area where the filter hast to be applied (selective filtering). For each filter (script) the user can manually define a mask. And so on.

It's not bad at all, when a solution has the possibility to ferment.

And feel free to make your own "Fritz Photo scripts", if you missed one. Keep in mind, the color space is always RGB32 or (double sized) YV12. YV12 normally requires a filter, where luma and chroma channels can be processed separately (the double sized luma channel has to be resized beforehand whereas the chroma channels can be filtered directly). Take care about unnecessary color space conversion. And last but not least we have to save the alpha channel (if any). To make a story short, take a look at the templates and you will see, how they work. http://forum.gleitz.info/images/smilies/santa.gif

Archimedes
20th December 2009, 16:42
Updated the newer ImageMagick libraries. Thanks to Wilbert.

Soulhunter
29th December 2009, 02:32
Great, some nice additions/improvements since I last tried it!

Some things I'd like to see in future...

- Steady preview, so you can see filter setting changes in realtime etc.

- Perhaps add some simpler/faster denoisers (current set only includes high quality but slow one)

- Changing the zoom of the before/after compare shouldn't process the image again but rescale/crop a buffered filtered image (much faster)

- Sliders for the filter settings and a blend/opacity (maybe even the full "Layer" functionality with darken/lighten/multiply etc.) setting for each filter

Archimedes
13th January 2010, 17:45
Cosmetic update for dpi scaling.

- Changing the zoom of the before/after compare shouldn't process the image again but rescale/crop a buffered filtered image (much faster)
Already thinking about this issue. Blend/Opacity for each filter is a good idea. I will add your points to my "thinking about it when i have time list".

EuropeanMan
7th March 2010, 01:30
Any updates on this filter?

Archimedes
11th March 2010, 13:46
Any updates on this filter?
No essential updates at the moment. In the meanwhile, if you want to use the layer function for each filter, you can do something like this: Create two scripts with the following content and copy them into the template directory (may be in a subdirectory called "Layer").

"LayerBegin.avs":
base_clip = last

"LayerEnd.avs":
# ==============================================================================
# http://avisynth.org/mediawiki/Layer
# ==============================================================================
op = "add"
level = 256
threshold = 255
use_chroma = True
# ==============================================================================

Import("lib\FritzPhoto\FritzPhoto.avs")

base_clip.isYV12() <> isYV12() ? Eval("""
base_clip = isYV12() ? base_clip.RGB32ToYV12() : base_clip.YV12toRGB32()
""") : Eval("""
NOP()
""")
base_clip = base_clip.isYV12() ? base_clip.ConvertToYUY2() : base_clip
last = isYV12() ? ConvertToYUY2() : last
Layer(base_clip.Crop(0, 0, last.Width, last.Height), last, op=op, level=level, threshold=threshold, use_chroma=use_chroma)
isYUY2() ? ConvertToYV12() : last

Place "LayerBegin" in front of the used filter and "LayerEnd" afterwards.

Archimedes
12th March 2010, 13:03
I made a small update.

Assuming that we have the following filters in our job list:

Spline36Resize
SuperSlowSharpen
dfttest

If we want to compare the result before SuperSlowSharpen with the result after dfttest there was no way to do this.

I have added context menus to the preview windows. Now, you can refresh each preview window separateley (click on the right mouse button and click on "Refresh").

Archimedes
22nd April 2010, 20:43
Added a script inspector. Now you are able to view and edit your parameters outside of an AviSynth script.

http://img691.imageshack.us/img691/6760/avisynthscripts0640x048e.jpg

markanini
23rd April 2010, 15:23
Thanks for adding median sharpening template. It really adds definition to small detail without too many I'll side effects.

I love following the development of Frtizphoto!

I've had fun "hacking" the NNEDI2 template, replacing strings with 'NNEDI3'. Same with the 'deinterlace' template which I use with 'turnleft' and 'turnright' for antialiasing.
It's indispensable for working with low-res, blocky and aliased images!

How do you use the average function?

Archimedes
23rd April 2010, 17:02
How do you use the average function?
Take "AverageBegin" in front of any filter and "AverageEnd" afterwards. In "AverageEnd" you can adjust the weight parameter. Same behavior with layer function.

Example:

AverageBegin
dfttest
AverageEnd

Another hint: If you want to hide some parameters from displaying in script inspector, just add a comment with the key word %%ScriptInspectorIgnore%% after the parameter.

Example: If you want to hide the parameter "denoise" (used in "SuperSlowSharpen") in script inspector, do this:

denoise = 0 # %%ScriptInspectorIgnore%%

Just uploaded a new update, where i've changed the behavior of reading and writing values through the script inspector.

Archimedes
30th April 2010, 14:41
Removed support for the script "FritzPhotoResize". With the implementation of the script inspector this script is no longer needed.

Depending on the AviSynth type, the script inspector do a simple validation of the input characters.

Added the ability to show tooltips for each parameter and value in script inspector. The information will be stored in the scripts.

A simple tooltip can be achieved with this:

# ==============================================================================
# http://forum.doom9.org/showthread.php?t=100626
# ==============================================================================
weight = 1.0
# ==============================================================================
# weight = Defines how much influence the previous filter should have
# ==============================================================================

Now, if you are in script inspector mode, you see a tooltip "Defines how much influence the previous filter should have" when your mouse cursor is moving over the parameter or the value.

If you want to show individual tooltips for parameter and its value, do this:

# ==============================================================================
# http://forum.doom9.org/showthread.php?t=100626
# ==============================================================================
weight = 1.0
# ==============================================================================
# weight = Defines how much influence the previous filter should have | [0.0, 1.0]
# ==============================================================================

Now, you will see "Defines how much influence the previous filter should have" when your mouse cursor is over the parameter and "[0.0, 1.0]" when your mouse cursor is over the value.

Some AviSynth types can only have discret values. For the boolean values "False" and "True" the script inspector automaticly add a pick list. If you want to create a pick list for other values, do this:

# ==============================================================================
# http://forum.doom9.org/showthread.php?p=1045226
# ==============================================================================
field = 0
# ==============================================================================
# field = PickList, False, {0, 1}
# ==============================================================================

This tells the script inspector, that it should create a pick list with the values 0 and 1. The booelean value "False" means, that the pick list is not readonly (sometimes it's better to put in a value directly and not over the list).

I've added already all pick list information i've found to the templates, but there are no informations for the tooltips at the moment. But the templates are already prepared for that. Keep in mind, that all tooltips have to be translated (from english to german).

Archimedes
7th May 2010, 03:28
Added tooltip informations to the scripts. If you have better explanations for the tooltips, please let me know.

Also added some levels to the script inspector: "Beginner", "Intermediate" and "Expert". An "Expert" see all parameters, an "Intermediate" only the essential parameters and so on.

Script inspector informations are structured as follows (example: GradFun2DBMod):

# ==============================================================================
# http://forum.doom9.org/showthread.php?t=144537
# ==============================================================================
thr = 1.2
thrC = 1.2
mode = 2
str = 0.8
strC = 0.0
temp = 50
adapt = 64
custom = "empty"
mask = True
radius = 2
range = 2
# ==============================================================================
# thr = True, False, Beginner, Strength for the luma channel | float
# thrC = True, False, Beginner, Strength for the chroma channel | float
# mode = True, False, Beginner, PickList, {1, 2, 3}, Mode for the addition of 16 pixels around the image | int, [1, 3]
# str = True, False, Beginner, Standard deviation (strength) of the luma noise | float
# strC = True, False, Beginner, Standard deviation (strength) of the chroma noise | float
# temp = True, False, Beginner, Strength for temporal stabilization | int
# adapt = True, False, Beginner, Threshold for luma-adaptative grain | int
# custom = True, False, Expert, PickList, {"empty"}, Use your own grain generator instead of AddGrain | string
# mask = True, False, Beginner, Adaptative deband mask | bool, {False, True}
# radius = True, False, Beginner, Radius for the mask | int
# range = True, False, Beginner, Range used in the mask | int
# ==============================================================================

The first boolean value stands for the visibility of the parameter. False means, that the parameter is not visible in the script inspector. The second value means the read only status of the parameter. The third value stands for the level. You have the choice between "Beginner", "Intermediate" and "Expert".

After that there may be a definiton of a pick list. And after that, there can be the information for the tooltips.

If no parameter information is available, the program works with default values. "True, False, Beginner" in a script are identical with this default values.

Archimedes
9th May 2010, 16:45
The script inspector can show now a font and color dialog (see script "Subtitle").

Fixed script inspector input checking.

Added a checkbox to disable script inspectors input checking. So you can enter "values" like "1.0/3.0" in a float type field.

Terka
24th May 2010, 16:34
Hi Archimedes. I wonder if is possible/usefull to use temporal filtering on photos. Mean using more shots and combining them using motion compensation scripts.

Heaud
9th June 2010, 10:53
Is there a script to add borders to an image in order to make it mod4, then removes the added borders? I want to batch run some images with gradfun2dbmod but it gives me errors due to the image size not being mod4.