PDA

View Full Version : Fritz Photo


Archimedes
22nd October 2009, 03: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 (http://forum.gleitz.info/showthread.php?t=33835).

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 2.6 or higher (http://sourceforge.net/projects/avisynth2/)
- Fritz Photo 2011.04.15 (templates from: 07/16/2011): Setup (http://www.mediafire.com/?d99m6dd4mmutbub) or Zip archiv (http://www.mediafire.com/?h1bd6d27cazufjm)

If you add an environment variable MAGICK_HOME = <Fritz Photo program directory>\dll\ImageMagick, you are able to read and write more graphic formats (see Immaavs (http://forum.doom9.org/showthread.php?t=135928) for more details).


Processing still images are divided into five steps.


1. Images

http://img710.imageshack.us/img710/6168/images0640x0480.jpg

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


2. Crop

http://img845.imageshack.us/img845/7137/crop0640x0480.jpg

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


3. AviSynth Scripts

http://img847.imageshack.us/img847/2131/avisynthscripts0640x048.jpg

On the top left side you see the template directory. With a double click on a template you load that template to the job list on the top right side (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

http://img40.imageshack.us/img40/6167/preview0640x0480.jpg

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

http://img20.imageshack.us/img20/5717/settings0640x0480.jpg

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.

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

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

thanks!

BHH

Leak
22nd October 2009, 10: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, 14:41
Am a happy customer of it :D
Good job Archimedes...

Archimedes
22nd October 2009, 15: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, 02: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, 16: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, 18:47
Seems very good, but it doesn't works on Win7 x64 for me... Someone can confirm?

eslave
24th October 2009, 03: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, 04:42
Firefox 3.5.3, works fine.

Leak
24th October 2009, 12: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, 16: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, 22: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 ?
25th October 2009, 00: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, 21: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, 16: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, 18: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, 15: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, 04: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, 17: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, 17: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, 11: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.

Archimedes
9th June 2010, 12:20
It seems, GradFun2DBMod needs a mod4 input. :o As we are working with double sized YY12 images, we need mod8 before feeding it to GradFun2DBMod.

In such cases, I simply crop the pixels on the right and bottom side.

Here is the corrected script.

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

LoadPlugin("plugins\AddGrainC\AddGrainC.dll")
LoadPlugin("plugins\GradFun2DB\gradfun2db.dll")
LoadPlugin("plugins\GScript\GScript.dll")
LoadPlugin("plugins\MaskTools 2\mt_masktools.dll")
LoadPlugin("plugins\RemoveGrain 1.0\RemoveGrain.dll")

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

isYV12() ? GEval("""
fp_GradFun2DBMod(thr, thrC, mode, str, strC, temp, adapt, custom, mask, radius, range)
""") : GEval("""
if (%%KeepAlphaChannel%%) {
fp_alpha = last
}
else {
NOP()
}
RGB32toYV12()
fp_GradFun2DBMod(thr, thrC, mode, str, strC, temp, adapt, custom, mask, radius, range)
if (%%KeepAlphaChannel%%) {
YV12toRGB32()
MergeARGB(fp_alpha.Crop(0, 0, last.Width, last.Height), last, last, last)
}
else {
NOP()
}
""")

function fp_GradFun2DBMod(clip input, float thr, float thrC, int mode, float str, float strC, int temp, int adapt, string custom, bool mask, int radius, int range) {
input = input.Crop(0, 0, -(input.Width % 8), -(input.Height % 8))

luma = thr < 1.0 ? input : input.PointResize(input.Width / 2, input.Height / 2).\
GradFun2DBMod(
\ thr = thr,
\ thrC = 1.0,
\ mode = mode,
\ str = str,
\ strC = 0.0,
\ temp = temp,
\ adapt = adapt,
\ custom = custom,
\ mask = mask,
\ radius = radius,
\ range = range
\ ).\
PointResize(input.Width, input.Height)

chroma = thrC < 1.0 ? input : input.\
GradFun2DBMod(
\ thr = 1.0,
\ thrC = thrC,
\ mode = mode,
\ str = 0.0,
\ strC = strC,
\ temp = temp,
\ adapt = adapt,
\ custom = custom,
\ mask = mask,
\ radius = radius,
\ range = range
\ )

luma.MergeChroma(chroma, 1)
}

Later on this day I will upload an update with the corrected script. I've also added the new SmoothAdjust plugin.

Archimedes
9th June 2010, 13:11
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.
Sorry for not answering immediately. I tested this once, but the results was not very impressive. So i gave it up. May be, it was my fault.

Terka
9th June 2010, 13:45
Archimedes, thank you for reply and testing. Have small experience with Fritzphoto, do i understand correctly, the functionality of combining more pictures is available? Where?

Archimedes
9th June 2010, 14:07
Not implemented at the moment. First i need some feeling of success outside of the program.

Terka
9th June 2010, 15:05
eg median could be useful when eg taking a picture of building and want to remove people in the front.

Archimedes
9th June 2010, 15:07
New update is available.

Changes:
lib:
- Removed SmoothLevels.
- Added "blah" (http://forum.doom9.org/showthread.php?t=155030 ) - a new sharpening function.

plugins:
- Updated MaskTools 2 and FFmpegSource2.
- Added SmoothAdjust (http://forum.doom9.org/showthread.php?t=154971).
- Added MedianBlur (required for "blah").

Templates:
- Changed SmoothLevels.
- Added SmoothCurve and SmoothTweak.
- Fixed GradFun2DBMod (works now with mod4 resolutions).

Archimedes
9th June 2010, 15:53
eg median could be useful when eg taking a picture of building and want to remove people in the front.
There are many other scenarios, where multiple images can help, like denoising and so on. My problem was, i always got blurred images, when using temporal informations in a script.

May be, the "motion" between the shots was to big. :D

Heaud
10th June 2010, 01:07
The new change to the gradfun2dbmod works fine, no more mod4 errors. One problem I have with it is that there is a loss of pixels. Is there any way to prevent that?

Archimedes
10th June 2010, 12:44
Adding (black) borders to an image before filtering and cropping the added borders afterwards is not always a good idea (depends on the filter), so i generally crop the needles pixels at the right and/or bottom side, if needed.

If the missing pixels are a problem for you, just add borders before filtering and crop the added borders afterwards.

Example:
# clip is RGB32 or (double sized) YV12

m = 4 # must be a power of 2, when clip is YV12
right = Width % m == 0 ? 0 : m - Width % m
bottom = Height % m == 0 ? 0 : m - Height % m

AddBorders(0, 0, right, bottom)

# Filter()

Crop(0, 0, -right, -bottom)

Heaud
11th June 2010, 01:42
The script is giving out odd numbers for cropping (if the mod4 remainer is an odd number) and that's causing trouble with cropping. I am not so experienced with scripting so I ask, is there a way to get the right and bottom variables to force even numbers?

foxyshadis
11th June 2010, 02:27
Add this to your script, top or bottom, or save it to an avsi file in your \avisynth 2.5\plugins folder:

function makemod(clip c,int "xmod",int "ymod",bool "crop") {
xmod=default(xmod,16)
ymod=default(ymod,xmod)
crop=default(crop,false)
c
ox=width
oy=height
xm=width%xmod
ym=height%ymod
w=c.isrgb32() || c.isrgb24() ? 1 : 2
right=c.crop(ox-w,0,w,0)
right=right.stackhorizontal(right,right,right)
right=xmod>w*4 ? right.stackhorizontal(right,right,right) : right
vx=ox % xmod==0 ? c : stackhorizontal(c,right.crop(0,0,xmod-(ox % xmod),0))
bottom=vx.crop(0,oy-w,0,w)
bottom=bottom.stackvertical(bottom,bottom,bottom)
bottom=ymod>w*4 ? bottom.stackvertical(bottom,bottom,bottom) : bottom
vy=oy % ymod==0 ? vx : stackvertical(vx,bottom.crop(0,0,0,ymod-(oy % ymod)))
cropped = c.crop(0,0,width-xm,height-ym)
return crop == true ? cropped : vy
}

Use it as:

MakeMod(4)

It'll mirror the edge pixels so that filters don't munge a huge black border into the image. I used to use it a lot when I did a lot of upscaling & filtering of web images, and it had to be fairly memory efficient.

Terka
11th June 2010, 10:16
Archimedes,
regarding blurred (out of focus) photos. Have you tried some deconvolution filters? The sharpening of videos is usually different to sharpening out of focus photos.

Archimedes
15th June 2010, 00:13
The script is giving out odd numbers for cropping (if the mod4 remainer is an odd number) and that's causing trouble with cropping.
That's why i wrote "must be a power of 2, when clip is YV12". :rolleyes: See the script only as a simple example, not as a ready to use solution which handles all possible input values.

I am not so experienced with scripting so I ask, is there a way to get the right and bottom variables to force even numbers?
Mirroring the edge pixels (see example from foxyshadis) should be the better way to add a border, if required. I already thought about this issue, but then i decide generally to crop unnecessary pixels (if required). So i didn't implement such a function yet.

Cropping unnecessary pixels already begins, when a conversion from RGB32 to YV12 takes place (if width or height of the image are not even numbers). So the best way should be a separate script (a template) which can be placed in front of any filter to make a special mod resolution.

I will provide two new scripts, called "FritzPhotoModStart" and "FritzPhotoModEnd". "FritzPhotoModStart" will have two parameters "xmod" and "ymod" (same parameters as in foxyshadis script :)) and should be the very first script in the job list (where the input is RGB32). "FritzPhotoModEnd" should be placed after filtering. It crops the added borders, so the image has its original resolution again.

Example (job list):
FritzPhotoModStart
GradFun2DBMod
FritzPhotoModEnd

Archimedes
15th June 2010, 01:00
Archimedes,
regarding blurred (out of focus) photos. Have you tried some deconvolution filters? The sharpening of videos is usually different to sharpening out of focus photos.
For this issue (deconvolution) i'm using Image Analyzer (http://logicnet.dk/Analyzer/). Super Slow Sharpen (rad >= 0.5) in combination with a denoiser are also a good candidate for strong sharpening tasks.

foxyshadis
15th June 2010, 02:56
Archimedes,
regarding blurred (out of focus) photos. Have you tried some deconvolution filters? The sharpening of videos is usually different to sharpening out of focus photos.

All of the sharpening filters used here already are useful approximations of deconvolution filters. *.mp4 guy, Didée and I have looked into real ones and come away with "not worth the time and effort," too much information is already thrown away by the time it gets into Avisynth. They may be more useful with 10+ bit raw photos, if you knew the exact lens curvature, but I've never had that kind of info.

Terka
15th June 2010, 09:50
Thank you both for reply! I know image analyzer. Have tried http://www.adptools.com/en/deblurmyimage-description.html. Best results got with astroart, but it is not free.
My source is raw image from nikon d70.

Archimedes
15th June 2010, 14:52
Update available.

Changes:
lib:
- Updated blah.

plugins:
- Updated SmoothAdjust.

Templates:
- Added FritzPhotoModBegin and FritzPhotoModEnd.

FritzPhotoModBegin has three parameters: xmod, ymod and crop. With xmod and ymod you can define your mod resolution (odd numbers are also allowed). With crop you simple crop the pixels on the right and/or bottom side to reach the specified mod resolution (normally not needed, because every script will do it automaticly, when a special mod resolution is required).

As I wrote above, FritzPhotoModBegin should be the very first script in the job list (before any color conversion is occuring). FritzPhotoModEnd should be placed at the very end of the job list. The script is cropping the added pixels and bring back the original resolution.

foxyshadis, thanks for sharing your script!

markanini
16th June 2010, 02:03
Great stuff that FritzPhotoMod! :D

Archimedes
17th June 2010, 03:40
Here is an example of an out of focus image (in combination with motion blur).

Original:
http://img51.imageshack.us/img51/4948/img8547kopie.th.jpg (http://img51.imageshack.us/i/img8547kopie.jpg/)

SSSharp and TNLMeans:
http://img197.imageshack.us/img197/8248/img8547kopie0900x0600ss.th.png (http://img197.imageshack.us/i/img8547kopie0900x0600ss.png/)

Terka
17th June 2010, 09:42
Archimedes, thank you for nice example. (I dont think there is a motion blur there.)
Please post your settings.
On first look i thought its not good result, but on second i think - its good! Thank you,
Terka

Archimedes
17th June 2010, 12:50
Archimedes, thank you for nice example. (I dont think there is a motion blur there.)
I should say, after sharpening it looks like a motion blur to me.

http://img171.imageshack.us/img171/8248/img8547kopie0900x0600ss.th.png (http://img171.imageshack.us/i/img8547kopie0900x0600ss.png/)

Please post your settings.
On first look i thought its not good result, but on second i think - its good!
Don't know it exactly, what parameter i have used. Settings were something like this:

SSSharp:
rad = 1.25
ssw = False
strength = 15.0
iter = 1
ss = True
denoise = 0

TNLMeans:
Ax = 10
Ay = 10
Sx = 3
Sy = 3
Bx = 1
By = 1
a = 0.96
h_y = 3.6
h_u = 0.0
h_v = 0.0
sse = True

Terka
17th June 2010, 13:08
which order?
1.nlmeans, 2. SSSharp or
1. SSSharp 2.nlmeans
I should say, after sharpening it looks like a motion blur to me. aha. i ment the original has motion blur.

maybee these areas could be eliminated. it looks like kind of ghosting. will be great if its possible.

Archimedes
17th June 2010, 13:21
Same order as i posted. 1. SSSharp. 2. TNLMeans.

*.mp4 guy
17th June 2010, 13:41
The effect is due to incompletely suppressed haloing and oversharpened "flat" blurring, you can see that the erroneous features are already slightly present in the source due to the characteristic out-of-focus blur from the camera. And yes the situation can be improved on, but its difficult to get that much sharpening without screwing up the already screwy blur-gradients.

Example1 (http://img291.imageshack.us/img291/8252/snapshot20100617072831.png)
Example2 (http://img228.imageshack.us/img228/4309/snapshot20100617072918.png)
Example3 (http://img638.imageshack.us/img638/4424/snapshot20100617072953.png)

Archimedes
17th June 2010, 13:41
I have changed the template SSSharp (SuperSlowSharpen) a little bit. After sharpening there was very often bright thin lines around the image. And there was also a problem with the denoise parameter (http://forum.doom9.org/showthread.php?p=1258304#post1258304) (not really usable). So i add a border (mirrored pixels) around the image before filtering and crop them after filtering. This helps.

*.mp4 guy
17th June 2010, 14:11
I'm not sure if that was directed at me, but the examples I posted were not generated with sssharp.

Archimedes
17th June 2010, 14:32
I'm not sure if that was directed at me, but the examples I posted were not generated with sssharp.
No, that was not directed to you. We have just posted at the same time. :)

Terka
17th June 2010, 16:04
*.mp4 guy, nice one, could i ask bout your code?
Have you some experience with decovolution methods like Lucy, Wiener..

*.mp4 guy
17th June 2010, 22:57
*.mp4 guy, nice one, could i ask bout your code?
Have you some experience with decovolution methods like Lucy, Wiener..

Its based on some bits of blah that I am fiddling with. Technically its not significantly similar in any way to any of the deconvolution methods I've read about. Its non-iterative, only needs to have a ballpark of the blur radius to function, and the noise suppression is just part of how it works. Its more similar to sssharp (and a bit less to medsharp) than anything else I know of, and its not particularly similar to either.

Terka
18th June 2010, 09:38
The posted examples are really good! Will you provide use with this sharpener?
If you have problem with name again ;), i suggest to call it OFF- Out of Focus Fixer

*.mp4 guy
18th June 2010, 11:30
Actually all the talk of Deconvolution, helped me think of a name, "Reconvolution (http://forum.doom9.org/showthread.php?p=1409582#post1409582)" since there isn't any reason to believe that its doing anything but making the picture look sharper by convolving it (albeit in a sneaky way). Also it works fine on stuff that isn't out of focus.

Settings for the posted examples were:
1 ReCon(str=8, rad=2, lmode=0)
2 ReCon(str=8, rad=2, lmode=1)
3 ReCon(str=8, rad=2, lmode=3)

Except from an older version, and therefore a bit worse overall. lmode 1 is now better, and lmode 2 pretty much replaces 3.

rfmmars
18th June 2010, 18:35
I have only one tab and the screen doesn't look like on page one. Load Avisynth 2.58, and installed your program twice, what am I doing wrong? Have no problem with AVSp or AVSpMod.

Thanks

http://img696.imageshack.us/img696/4615/fritzphotoopening.jpg (http://img696.imageshack.us/i/fritzphotoopening.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

Archimedes
19th June 2010, 13:35
On Windows 7 i prefere to use the Windows Classic Style, that’s why the screenshots looks different. When you start the program, you will always see only one tab. After loading at least on image, you can click "Next" and then you will see the next tab and so on.

Archimedes
19th June 2010, 14:28
Added "ReCon" (http://forum.doom9.org/showthread.php?p=1409582#post1409582) to the sharpening templates. May be someone would like to test it.

markanini
19th June 2010, 17:56
Just played with the parameters of ReCon. Seems to work well!

rfmmars
19th June 2010, 17:59
I have only one tab and the screen doesn't look like on page one. Load Avisynth 2.58, and installed your program twice, what am I doing wrong? Have no problem with AVSp or AVSpMod.

Thanks

http://img696.imageshack.us/img696/4615/fritzphotoopening.jpg (http://img696.imageshack.us/i/fritzphotoopening.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

Thanks, that made it work for me, vert nice.

Richard

Archimedes
21st June 2010, 16:10
Updated ReCon.

markanini
26th June 2010, 11:43
Archimedes, how about a difference tab in addition to before-after? I think it would be very useful for denoising.

Archimedes
28th June 2010, 09:38
This can be realized also with a simple script. I will think about it.

Terka
28th June 2010, 14:45
good idea!

dlnm
28th June 2010, 17:53
Is there a script to remove some jpeg artifacts near the edges? or may be just use a deringing script such as HQDering?
Thanks.

Archimedes
28th June 2010, 22:10
TNLMeans (maybe with Bx=By=0)?

Source (20 % JPG Quality) (http://img30.imageshack.us/img30/5812/img23890800x0600.png)
TNLMeans (http://img638.imageshack.us/img638/3888/img23890800x06000800x06.jpg)

Terka
29th June 2010, 09:42
look at fft3d:
http://www.aquilinestudios.org/avsfilters/spatiotemp.html

dlnm
29th June 2010, 18:56
Thanks both Archimedes and Terka.
I have tried both TNLMeans and dfttest before but the results are not satisfied. It seems that fft3d did better in this case.

Reuf Toc
29th June 2010, 19:53
Maybe you can try Deblock_QED (http://avisynth.org/mediawiki/Deblock_QED) in addition with FFT3D or TNLMeans (I didn't tested so I don't know if it works with Jpeg artifacts)

Archimedes
27th July 2010, 12:05
Updated the plugins NNEDI2 and EEDI3. The updates for NNEDI3 and the ImageMagick libraries already updated in the last "silent" update. Thanks to tritical and Wilbert.

For anti aliasing I added the script "SantiagMod" (http://forum.doom9.org/showthread.php?p=1419815#post1419815 ) (could be improved with an edge mask, but this requires YV12 as input).

Source (PointResize from 3264x2448 to 1024x768) >> (http://img137.imageshack.us/img137/1784/sn850643pointresize.png)

SantiagMod(type="EEDI3", strh=1, strv=1) >> (http://img43.imageshack.us/img43/7374/sn850643santiagmodeedi3.jpg)
SantiagMod(type="EEDI3", strh=2, strv=2) >> (http://img29.imageshack.us/img29/7374/sn850643santiagmodeedi3.jpg)

SantiagMod(type="NNEDI3", strh=1, strv=1) >> (http://img641.imageshack.us/img641/6032/sn850643santiagmodnnedi.jpg)
SantiagMod(type="NNEDI3", strh=2, strv=2) >> (http://img815.imageshack.us/img815/6032/sn850643santiagmodnnedi.jpg)

markanini
28th July 2010, 02:14
Awesome!

Terka
8th September 2010, 11:58
Archimedes,
regarding my request for adding mo-compensation in Fritz Photo, please see:
http://forum.doom9.org/showthread.php?p=1160020#post1160020

Archimedes
28th September 2010, 19:51
Program didn't start in one case. So I've changed the windows message calls for registering and unregistering fonts.

Updated the plugins "FFmpegSource2", "Mask Tools 2" , "NNEDI3" and "SmoothAdjust".

Revgen
30th September 2010, 09:28
Any chance you can add VCMohan's Seamer Resizer? http://forum.doom9.org/showthread.php?t=135735

Archimedes
30th September 2010, 19:03
Any chance you can add VCMohan's Seamer Resizer? http://forum.doom9.org/showthread.php?t=135735
I already have implemented this plugin in the past. But then I decide to delete it (make no sense for me, to use it). :D

However, it's easy to implement:

1. Copy the plugin to "Fritz Photo\plugins\Seamer" directory.
2. Copy the following scripts to "Fritz Photo\Templates\Seamer" directory (extension should be "avs").

TRSeamer.avs:
# ==============================================================================
# http://forum.doom9.org/showthread.php?t=135735
# ==============================================================================
x = 800
y = 600
peak = False
alt = False
# ==============================================================================
# x = True, False, Beginner, Desired width of output frame | int
# y = True, False, Beginner, Desired height of output frame | int
# peak = True, False, Beginner, Whether to use highs or lows as seam carving | bool, {False, True}
# alt = True, False, Beginner, Whether seams are to be affected alternately along width and height | bool, {False, True}
# ==============================================================================

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

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

isYV12() ? YV12toRGB32() : NOP()
TRSeamer(x=x, y=y, peak=peak, alt=alt)

WSSeamer.avs:
# ==============================================================================
# http://forum.doom9.org/showthread.php?t=135735
# ==============================================================================
x = 800
y = 600
peak = False
alt = False
# ==============================================================================
# x = True, False, Beginner, Desired width of output frame | int
# y = True, False, Beginner, Desired height of output frame | int
# peak = True, False, Beginner, Whether to use highs or lows as seam carving | bool, {False, True}
# alt = True, False, Beginner, Whether seams are to be affected alternately along width and height | bool, {False, True}
# ==============================================================================

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

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

isYV12() ? YV12toRGB32() : NOP()
WSSeamer(x=x, y=y, peak=peak, alt=alt)

Will be part of the next update.

Archimedes
5th November 2010, 11:19
Updated the plugins "SmoothAdjust" and "FFmpegSource2". Added the plugin "Seamer".

Terka
8th November 2010, 13:18
Archimedes,
what about the mvtools ;)
plz :)

Archimedes
21st January 2011, 00:25
Changed to version 2.6.0 of AviSynth. Fixed the chroma shift problem, when doing color conversions (from RGB32 to double sized YV12 and vice versa). :)

Added language support for the template directories and the parameters in script inspector (while the german translation for the template folders are ready, i need some time to finish the translation for the parameter descriptions).

Added "NLMeansCL" to the denoise section.

markanini
6th February 2011, 02:28
Eedi3 latest version doesnt seem to like avisynth 2.6? I keep getting an error about eedi3 failing to load. My dirty fix was replacing eedi3.dll w/ unknown older version.

Archimedes
7th February 2011, 14:21
Works fine here with the latest alpha release (http://sourceforge.net/projects/avisynth2/files/AviSynth_Alpha_Releases/AVS%202.6.0%20Alpha%202%20%5B090927%5D/).

markanini
7th February 2011, 23:22
I'm using SET's lasest 2.6 MT build actually.

markanini
8th February 2011, 18:48
I guess I'll have to keep my old EEDI3 version as I'd hate to choose between MT functionality and FritzPhoto.

A question about the resize templates; is there any way to input decimal values instead of absolute values?

PS: Please consider adding a template for automttap3. In my testing scaling a megapixel original to web-size I found it resolved fine texture in a flattering way that spline and lanczos couldn't do.

PS 2: Same problem with warpsharp.dll, again replaced it with unknown different version from the attic of my harddrives to be functional...

Archimedes
10th February 2011, 00:20
A question about the resize templates; is there any way to input decimal values instead of absolute values?

PS: Please consider adding a template for automttap3. In my testing scaling a megapixel original to web-size I found it resolved fine texture in a flattering way that spline and lanczos couldn't do.
Will be part of the next update.

Same problem with warpsharp.dll, again replaced it with unknown different version from the attic of my harddrives to be functional...
Strange. Works also fine here. What error message do you get?

markanini
10th February 2011, 00:30
Will be part of the next update.


Strange. Works also fine here. What error message do you get?
:D


It's a generic "failed to load xyz.dll".

Archimedes
10th February 2011, 02:14
When you load the plugins outside of Fritz Photo (e. g. with VirtualDub), do you receive the same error messages?

markanini
10th February 2011, 03:02
Tried load both plugins in Avidemux AVS proxy and they failed to load in both cases. I'll uninstall SETs 2.6 build and install the vanilla 2.6 build and see what happens.

Archimedes
10th February 2011, 15:58
Here is the template (Fritz Photo script) for the automttap3 function.

1. Save the automttap3 function (http://forum.doom9.org/showthread.php?p=1211873#post1211873) to lib\automttap3\automttap3.avs in the program directory.

2. Save the following script to Templates\Resize\automttap3.avs in the program directory.

# ==============================================================================
# http://forum.doom9.org/showthread.php?p=1211873#post1211873
# ==============================================================================
Width = 800
Height = 600
mtaps3 = 1
thresh = 256
ss_x = 1.0
ss_y = 1.0
KeepAspectRatio = True
Oversize = False
ForceResize = False
# ==============================================================================
# Width = True, False, Beginner, Width | int
# Height = True, False, Beginner, Height | int
# mtaps3 = True, False, Beginner, Amount of taps | int
# thresh = True, False, Beginner, Threshold | int, [0, 256]
# ss_x = True, False, Intermediate, Horizontal supersampling factor | float
# ss_y = True, False, Intermediate, Vertical supersampling factor | float
# KeepAspectRatio = True, False, Beginner, Keep aspect ratio | bool, {False, True}
# Oversize = True, False, Intermediate, Ensures that the resized image is even or greater than width x height | bool, {False, True}
# ForceResize = True, False, Beginner, Force resize (enlargement mode) | bool, {False, True}
# ==============================================================================

LoadPlugin("plugins\GScript\GScript.dll")
LoadPlugin("plugins\MaskTools 2\mt_masktools-26.dll")

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

isYV12() ? GEval("""
if (ForceResize) {
fp_automttap3(Width=Width, Height=Height, mtaps3=mtaps3, thresh=thresh, ss_x=ss_x, ss_y=ss_y, KeepAspectRatio=KeepAspectRatio, Oversize=Oversize)
}
else {
Oversize == false ? Width < (last.Width / 2) || Height < (last.Height / 2) ? fp_automttap3(Width=Width, Height=Height, mtaps3=mtaps3, thresh=thresh, ss_x=ss_x, ss_y=ss_y, KeepAspectRatio=KeepAspectRatio, Oversize=Oversize) : NOP() : Width < (last.Width / 2) && Height < (last.Height / 2) ? fp_automttap3(Width=Width, Height=Height, mtaps3=mtaps3, thresh=thresh, ss_x=ss_x, ss_y=ss_y, KeepAspectRatio=KeepAspectRatio, Oversize=Oversize) : NOP()
}
""") : GEval("""
if (%%KeepAlphaChannel%%) {
fp_alpha = Crop(0, 0, -(last.Width % 2), -(last.Height % 2))
}
else {
NOP()
}
if (ForceResize) {
RGB32toYV12().fp_automttap3(Width=Width, Height=Height, mtaps3=mtaps3, thresh=thresh, ss_x=ss_x, ss_y=ss_y, KeepAspectRatio=KeepAspectRatio, Oversize=Oversize)
}
else {
Oversize == false ? Width < last.Width || Height < last.Height ? RGB32toYV12().fp_automttap3(Width=Width, Height=Height, mtaps3=mtaps3, thresh=thresh, ss_x=ss_x, ss_y=ss_y, KeepAspectRatio=KeepAspectRatio, Oversize=Oversize) : NOP() : Width < last.Width && Height < last.Height ? RGB32toYV12().fp_automttap3(Width=Width, Height=Height, mtaps3=mtaps3, thresh=thresh, ss_x=ss_x, ss_y=ss_y, KeepAspectRatio=KeepAspectRatio, Oversize=Oversize) : NOP()
}
if (%%KeepAlphaChannel%% && isYV12()) {
fp_clip1 = YV12toRGB32()
fp_alpha.ShowAlpha("YV12").PointResize(fp_alpha.Width * 2, fp_alpha.Height * 2)
fp_automttap3(Width=Width, Height=Height, mtaps3=mtaps3, thresh=thresh, ss_x=ss_x, ss_y=ss_y, KeepAspectRatio=KeepAspectRatio, Oversize=Oversize)
MergeARGB(last.PointResize(last.Width / 2, last.Height / 2), fp_clip1, fp_clip1, fp_clip1)
}
else {
NOP()
}
""")

function fp_automttap3(clip input, int "Width", int "Height", int "mtaps3", int "thresh", float "ss_x", float "ss_y", bool "KeepAspectRatio", bool "Oversize") {
KeepAspectRatio == True ? GEval("""
Width = (Oversize == true) ? Width + (Width % 2) : Width
Height = (Oversize == true) ? Height + (Height % 2) : Height
Width = (Oversize == false) ? (Round(Float(Width) * input.Height / input.Width) <= Height) ? Width : Round(Float(Height) * input.Width / input.Height) : (Round(Float(Width) * input.Height / input.Width) < Height) ? Round(Float(Height) * input.Width / input.Height) : Width
Height = Round(Float(Width) * input.Height / input.Width)
""") : GEval("""
NOP()
""")
Width = (ss_x > 1.0) ? Round(Float(Width) * ss_x / 2) * 2 : Width
Height = (ss_y > 1.0) ? Round(Float(Height) * ss_y / 2) * 2 : Height
Width = Width - (Width % 2)
Height = Height - (Height % 2)
input.PointResize(input.Width / 2, input.Height / 2)
automttap3(dx=Width, dy=Height, mtaps3=mtaps3, thresh=thresh)
PointResize(last.Width * 2, last.Height * 2)
MergeChroma(input.YV12ToRGB32().Spline36Resize(Width, Height).RGB32ToYV12(), 1)
}

3648 x 2736 --> 640 x 480, Spline36Resize >> (http://img715.imageshack.us/i/z3hs1n8ns1t0640x0480spl.jpg/)
3648 x 2736 --> 640 x 480, automttap3 >> (http://img140.imageshack.us/i/z3hs1n8ns1t0640x0480aut.jpg/)

markanini
10th February 2011, 17:02
Thanks Archimedes!
So I've been spending the last hour seeing if I can sort out my issues. Going back and forth between sf.net, XhmikosR and SEt 2.6 build and avisynth plugin directory renamed to avoid issue with incomatible plugins and autoloading scripts. I made the following findings:
Warpsharp works fine, just my plugins folder causing trouble I guess.
EEDI3 failes to load with all builds.

Archimedes
2nd March 2011, 21:43
Added drag-and-drop functionality to the AviSynth Scripts page (moving scripts from the templates to the job list and vice versa). Ordering the job list with drag-and-drop operations is also possible now.

Added "Refresh image before filtering with the selected script" and "Refresh image after filtering with the selected script" to the context menus in the preview windows. Should be self-explanatory. ;)

Archimedes
17th March 2011, 17:20
Simplified the resize templates and added the possibility to enter scaling factors (in percent). With the new parameter "Unit" you can define, whether the parameters "Width" and "Height" are treated as pixel or percent values.

I've also added the new "ResampleHQ" (http://forum.doom9.org/showthread.php?t=160038) plugin.

Archimedes
28th March 2011, 15:15
Added more encoding options for the JPEG format:

- Color Space (RGB, Grey Scale, YCbCr, CMYK, YCbCrK)
- Chroma Subsampling (4:1:1, 4:2:2, 4:4:4)
- DCT Method
- Optimal Huffman Table (more compression)

markanini
28th March 2011, 19:08
Nice to have more options to set. Thanks!

Archimedes
1st April 2011, 11:02
Some things I'd like to see in future...

- Steady preview, so you can see filter setting changes in realtime etc.
Viewing changes in real-time is a little bit problematic because a lot of AviSynth filters are very slow. TNLMeans, for example, need a few minutes to calculate. No way for viewing changes in real-time. That's why I prefere the solution with the refresh button.

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

- Changing the zoom of the before/after compare shouldn't process the image again but rescale/crop a buffered filtered image (much faster)
I've changed that. Now it is possible to zoom in and out without processing the image again. Will be part of the next update.

Archimedes
8th April 2011, 14:15
- Changed zoom function in the preview windows. Now you can zoom in and out without processing the image again.
- Fixed a memory leak when processing AviSynth scripts.
- Added an additional crop page, where you can rotate and crop images in front of any filtering.
- Updated ResampleHQ plugin and script.

Terka
12th April 2011, 13:48
Archimedes, nice work in summary. Have one suggestion (besides mvtools implementing ;)): using key 'TAB' and 'SHIFT-TAB' to switch between values when editing parameters.

Thank you, T.

Archimedes
12th April 2011, 16:40
Changed and will be part of the next update. Tab and enter key now switch between the values. Thanks for pointing out that.

Archimedes
12th April 2011, 17:52
There you go. Will upload the package immediately.

Terka
21st April 2011, 16:19
Thank you!

Yobbo
15th May 2011, 15:35
This thing's stupid, I can never get it to work. I get "avisynth open error - there is no function ConvertToYV24"... If I try using ImmaRead I get "haven't sent MAGICK_HOME variable" blah blah. SO frustrating.

Archimedes
16th May 2011, 13:25
Program needs AviSynth 2.6 or higher and (when using the Immaavs plugin) an environment variable MAGICK_HOME = <Fritz Photo program directory>\dll\ImageMagick as described in the first post.

Archimedes
16th July 2011, 15:59
Updated the plugins Defish, ResampleHQ, NNEDI3 and SmoothAdjust and changed some templates. Added german translation for the parameter descriptions (need to be tested).

naoan
14th October 2011, 08:04
Hi, this is very useful app, but I got avisynth runtime error after processing 11 images and it always happen, any workaround for this?

markanini
14th October 2011, 08:18
Which Avisynth build are you running?

naoan
14th October 2011, 09:24
Latest 2.6 alpha (110525), it seems the problem is with dfttest, and it's not exactly 11 images before it crash. Sometimes I could process all intended files (was 46) sometimes it crash at only 9.

markanini
14th October 2011, 09:43
Try SETs 2.6 MT build.

naoan
14th October 2011, 10:04
I used that one before trying official build, it crash more often on Fritz Photo but never on normal encoding.

Archimedes
14th October 2011, 16:25
Did a quick test with 212 images from a digital camera (original resolution). No problems here (latest alpha release of AviSynth) with dfttest.

What is the task manager telling you while processing? Do you have enough memory?

naoan
14th October 2011, 17:37
Fritz use up to 100MB of memory, going down to 30MB and up again for each Image, I have 4GB of ram so it doesn't seems to be the problem. I just tried avisynth set build and it processed up to 31 image before throwing this error :

http://i.imgur.com/RflRa.png

My script is simple greyscale and dfttest, using sigma 256 since it's a comic scans, maybe that's the problem?

Archimedes
22nd November 2011, 14:56
Is dfttest the only case, where you get such error message? Try other plugins and make a test with no filtering (only graphic format conversion).

chainring
23rd November 2011, 00:51
I'm having a problem on Win7 x64 where none of the tabs have labels and most of the windows are blank. In the preview window, I have to hit "Refresh" before the images will show up. Anything special for running on 64 bit?

naoan
23rd November 2011, 16:35
Is dfttest the only case, where you get such error message? Try other plugins and make a test with no filtering (only graphic format conversion).

I just tried fft3dfilter and have the same problem as dfttest after some image. Lsfmod, Msmooth and plain conversion (jpeg to png) worked without a hitch though.

Archimedes
29th November 2011, 23:37
Fritz Photo run all AviSynth scripts in thread. If there is a crash, you normally will receive the same crash (the same error message) when starting the script outside of the program (e. g. in Virtual Dub).

Don’t’ know exactly, what the problem is here. I will provide you with another exe file for further testing.

Archimedes
29th November 2011, 23:46
I'm having a problem on Win7 x64 where none of the tabs have labels and most of the windows are blank. In the preview window, I have to hit "Refresh" before the images will show up. Anything special for running on 64 bit?
The program was developed with Borland Delphi 2005 Personal Edition (32 bit). Never tested it in a 64 bit environment. I will make some tests on 64 bit systems. ;)

Regarding the preview window, this is the normal behavior, you allways have to hit the refresh button, before seeing pictures.

chainring
30th November 2011, 07:57
The program was developed with Borland Delphi 2005 Personal Edition (32 bit). Never tested it in a 64 bit environment. I will make some tests on 64 bit systems. ;)

Regarding the preview window, this is the normal behavior, you allways have to hit the refresh button, before seeing pictures.Cool, thank you for looking into the 64bit thing.

I did try it in a Win XP 32bit virtual machine and all is good.

Archimedes
3rd December 2011, 13:54
I just tried fft3dfilter and have the same problem as dfttest after some image. Lsfmod, Msmooth and plain conversion (jpeg to png) worked without a hitch though.
Both filters (FFT3DFilter and dfttest) are using the FFTW library (but each another version). But do not know, wether it has to do with your problems. :D

However, here is a test (debug) version. Please copy the file to the program directory of Fritz Photo, start it and try again.

http://www.mediafire.com/?8c1ma68vzzip8z8

naoan
4th December 2011, 01:02
Both filters (FFT3DFilter and dfttest) are using the FFTW library (but each another version). But do not know, wether it has to do with your problems. :D

However, here is a test (debug) version. Please copy the file to the program directory of Fritz Photo, start it and try again.

http://www.mediafire.com/?8c1ma68vzzip8z8

Thanks, I'll report back after I've done testing.

markanini
19th December 2011, 16:21
Could you possibly add 'show' parameter to the Smoothadjust plugins, Archimedes?