RetouchPRO

Go Back   RetouchPRO > Tools > Software
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Software Photoshop, Lightroom, Paintshop Pro, Painter, etc., and all their various plugins. Of course, you can also discuss all other programs, as well.

FilterMeister - General Info

Reply
 
Thread Tools
  #11  
Old 03-04-2006, 06:06 AM
NancyJ's Avatar
NancyJ NancyJ is offline
Senior Member
 
Join Date: Jun 2004
Posts: 729
is it just me or do none of the examples in the tutorials compile? I managed to get the blur example to compile by changing 'true' to return true... but some of them are like for(y=0; y and then they go onto the next line so I cant fill in the blanks because I dont know what they should be
Reply With Quote top
  #12  
Old 03-04-2006, 07:28 AM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Hi Nancy.
It’s nice to see you here.

I have never had a problem compiling any of the examples I have tried (I have not tried them all)
The ‘Border Code’ (Post 8) is straight from the manual.
I have tried most of the example source code which is downloaded with FilterMeister, and again, never had a problem.

One problem I have had occasionally is in the formatting of the code.
Try this.
Instead of copying and pasting straight to FM. First paste the code to Notepad. Then copy the code from Notepad and Paste this to FM.

If that does not help then can you give a specific example of code that is not compiling.


Ken
Reply With Quote top
  #13  
Old 03-04-2006, 09:04 AM
NancyJ's Avatar
NancyJ NancyJ is offline
Senior Member
 
Join Date: Jun 2004
Posts: 729
This is straight out the manual - for blend and labelled example

Code:
%ffp
//This example blends the image with a mirrored version of itself

ctl(0): "Ratio",range=(0,255),val=128
ctl(1): combobox(vscroll),action=preview, color=#FFFFFF,fontcolor=#0000ff, size=(50,200),
text="Normal\nDissolve\nThreshold\nThreshold 2\nMultiply\nScreen\nOverlay\nSoft Light\nHard Light\nDodge\nBurn\nDarken\nLighten\nExclusion\nDifference\nNegDif 1\nNegDif 2\nSubtract\nAdd\nExpose",
val=0

ForEveryTile:
{
for (y=y_start; y
updateProgress(y,y_end);
for (x=x_start; x
for (z=0; z
pset(x, y, z, blend (src(x,y,z), src(X-x,Y-y,z) , z, ctl(1),ctl(0)) );

}}}
return true;
}
The for loops are incomplete
This example is one from the tutorials
Code:
%ffp

Category: "FM Tutorial"
Title: "Blur II"
Author: "Ilyich the Toad"

ctl[0]:"Blur &Width",range=(2,scaleFactor*X/2),val=3,pagesize=3,linesize=1
ctl[1]:"Blur &Height",range=(2,scaleFactor*Y/2),val=3,pagesize=3,linesize=1

ForEveryTile:
{

int kernelheight; int kernelwidth;
int xlook; int ylook;
int sum; int amount; int progress;

setCtlRange(0,2,scaleFactor*X/2); setCtlRange(1,2,scaleFactor*Y/2);

kernelheight=max(ctl(1)/scaleFactor, 1); //avoiding zero kernel on small preview
kernelwidth=max(ctl(0)/scaleFactor, 1); //avoiding zero kernel on small preview

progress=0;


// --------------------------------
// Blur - first pass (along X-axis)
// --------------------------------

for (y=0; y < Y; y++) {
 if(updateProgress(progress,2*Y)) break;
 progress++;
 for (x=0; x < X; x++) {
  for (z= 0; z < Z; z++) {
   sum=0; amount=0;
   for (xlook=0; xlook<kernelwidth; xlook++)
    {
     sum+= src((x+xlook-kernelwidth/2),y,z);
     amount++;
    }; //accumulate pixels in a raw
   tset(x,y,z,sum/amount); //divide the sum onto kernel size
  }
 }
}


// ---------------------------------
// Blur - second pass (along Y-axis)
// ---------------------------------


for (y=0; y < Y; y++) {
 if(updateProgress(progress, 2*Y)) break;
 progress++;
 for (x=0; x < X; x++) {
  for (z= 0; z < Z; z++) {
   sum=0; amount=0;
   for (ylook=0; ylook<kernelheight; ylook++)
    {
     sum+= tget(x,(y+ylook-kernelheight/2),z);
     amount++;
    }; //accumulate pixels in a column
   pset(x,y,z,sum/amount); //divide the sum onto kernel size
  }
 }
}

updateProgress(0, 100);
true;
}
It doesnt compile because the last line says 'true' instead of 'return true'.
Reply With Quote top
  #14  
Old 03-04-2006, 12:31 PM
byRo's Avatar
byRo byRo is offline
Senior Member
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,609
Hi, Nancy, good to see you around here.

Working with Filtermeister is a bit like trying to get into Deep Paint - very little organized information at all. You just have to keep reading around and trying to piece the stuff together.

Stroker and I, can probably help out with most things if you need.

This is the first one corrected:
Code:
%ffp
//This example blends the image with a mirrored version of itself

ctl(0): "Ratio",range=(0,255),val=128
ctl(1): combobox(vscroll),action=preview, color=#FFFFFF,fontcolor=#0000ff, size=(50,200),
text="Normal\nDissolve\nThreshold\nThreshold 2\nMultiply\nScreen\nOverlay\nSoft Light\nHard Light\nDodge\nBurn\nDarken\nLighten\nExclusion\nDifference\nNegDif 1\nNegDif 2\nSubtract\nAdd\nExpose",
val=0

ForEveryTile:
{
for (y=y_start; y<y_end; y++) {
updateProgress(y,y_end);
for (x=x_start; x<x_end; x++) {
for (z=0; z<Z; z++) {
pset(x, y, z, blend (src(x,y,z), src(X-x,Y-y,z) , z, ctl(1),ctl(0)) );
}}}
return true;
}
As for the second one - the final line should be "return true;" (which basically means that this part of the code is going to affect the output image)

Anything else you need, your wish is my command.

Reply With Quote top
  #15  
Old 03-05-2006, 10:40 AM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Craig (Kraellin) requested a masking filter here
http://www.retouchpro.com/forums/software/12957-free-equalization-plugins-byro.html

I can’t find any way to make this selection in one go.
The magic wand will select the painting quite easily using a setting of 10 and making several ‘Adds’
Using colour range or Hue/sat will not work.

Any Ideas?

Ken.

Code:
Ctl(0): "Red Min", Pos=(280,10),val=255,track
Ctl(1): "Red Max", Pos=(280,20),val=255,track
Ctl(2): "Green Min", Pos=(280,30),val=255,track
Ctl(3): "Green Max", Pos=(280,40),val=255,track
Ctl(4): "Blue Min", Pos=(280,50),val=255,track
Ctl(5): "Blue Max", Pos=(280,60),val=255,track

R:  ctl(1) > ctl(0) &  r > ctl(0) & r < ctl(1)? A=255 :r
G:  ctl(3) > ctl(2) &  g > ctl(2) & g < ctl(3)? A=255 :g
B:  ctl(5) > ctl(4) &  b > ctl(4) & b < ctl(5)? A=255 :b
Reply With Quote top
  #16  
Old 03-06-2006, 05:44 AM
NancyJ's Avatar
NancyJ NancyJ is offline
Senior Member
 
Join Date: Jun 2004
Posts: 729
'y_end', ofcourse, why didnt I think of that It just seems strange that examples in the documentation dont work.
Something I noticed running the lab desat code Stroker posted was that it introduced a lot of compression artifacts - I assume thats because of the ForEveryTile rather than ForEveryPixel, I tried altering the code but then it became so slow. I've noticed that with other code examples, it takes quite a while to do and recreates the preview everytime you move a slider or press a button etc.
Reply With Quote top
  #17  
Old 03-06-2006, 07:29 AM
NancyJ's Avatar
NancyJ NancyJ is offline
Senior Member
 
Join Date: Jun 2004
Posts: 729
Ok, I think I'm getting to grips with what does what... but how do you set the tile size?
Reply With Quote top
  #18  
Old 03-06-2006, 09:33 AM
byRo's Avatar
byRo byRo is offline
Senior Member
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,609
Quote:
Originally Posted by NancyJ
'y_end', ofcourse, why didnt I think of that It just seems strange that examples in the documentation dont work.
Don't worry. you'll get used to it.
Quote:
Originally Posted by NancyJ
Something I noticed running the lab desat code Stroker posted was that it introduced a lot of compression artifacts
Seems that you are using an image that has been through JPEG compression somewhere along the line.
JPG compression applies different parameters to Luminosity and Colours - basically using an 8 x 8 pixel base for Luminosity and 16 x 16 for Colours. Also, I believe, JGP will discard a lot more Colour information than Luminosity when you lower the quality. This is done because we perceive the artifacts much less in the colours.
Now, if you are going to make use of the (noisy) colour information to make your new Luminosity then the artifacts will be more visible.
Quote:
Originally Posted by NancyJ
I've noticed that with other code examples, it takes quite a while to do and recreates the preview everytime you move a slider or press a button etc.
Yes, that's the (default) way it works. your code gets processed again every time you touch something. For a simple filter that's fine. When processing takes longer then it's a good idea to take some control over this.
Quote:
Originally Posted by NancyJ
but how do you set the tile size?
Dunno, don't think you do. Never had to worry about this, seems that when you start using src(), pget(), pset() etc. the tile is just the whole image. As I understand it, this would only be a worry for a very big image in a very complex filter.

hope this helped,

Reply With Quote top
  #19  
Old 03-06-2006, 09:42 AM
NancyJ's Avatar
NancyJ NancyJ is offline
Senior Member
 
Join Date: Jun 2004
Posts: 729
Just seems to me that if the tile is the whole image then the function is moot.
A lot of the examples I've seen start with ForEveryTile then for(z) for (y) for(x), which is equivalent to ForEveryPixel, surely?

Last edited by NancyJ; 03-06-2006 at 11:32 AM.
Reply With Quote top
  #20  
Old 03-06-2006, 10:48 AM
byRo's Avatar
byRo byRo is offline
Senior Member
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,609
Well, yes, sortta, not quite.
Sweeping through the (preview) image is automatic and happens every time you alter anything.
As FM is doing this this, it will run parts of your code as identified by "handlers".
The name of the handler (good word to remember) tells you when it will be called.

OnFilterStart: Just once at the start
ForEveryTile: Once for each tile
ForEveryPixel: Once for each pixel
OnFilterEnd: Just once at the end
OnCtl(n): Every time you touch a control.

So, if you use ForEveryPixel, then you don't need to (well, "should not", actually) use any looping, 'cuz FM is already doing that for you. (Which is probably what happened to you - for every pixel, you code was looping through the whole tile.)

If the tile is the whole image, then OnFilterStart and ForEveryTile are just about the same thing.

As posted somewhere above, there is no handler for when your filter is first activated - the OnFilterStart runs once every time you touch something. If you want to initialize (as I did) then you need a flag. As in stroker's suggestion, you can use one of the pre-definied global integers (i0...i9) which are initalized as 0. Just test for 0, and set it to 1 after initializing the filter.

OnCtl(n) is used for administration of the dialog. You can test for n to discover which control was actioned.

Quote:
Originally Posted by NancyJ
A lot of the examples I've seen start with ForEveryTile then for(z) for (y) for(x), which is equivalent to ForEveryPixel, surely?
For the simplest filters, yes, that works. Although I read, somewhere, that ForEveryPixel is not the recommended method.

Hope that explained it.
If you have any more doubts, please ask.


Last edited by byRo; 03-06-2006 at 10:57 AM.
Reply With Quote top
Reply

  RetouchPRO > Tools > Software


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Important security info chrishoggy Salon 11 02-16-2007 03:31 PM
scratch info in info palette seanarmenta Photoshop Help 5 08-11-2006 09:32 PM
Using info from green channel, any help? RobArnold Image Help 8 12-07-2005 07:04 AM
File > File Info - Does Elements have this menu command? DannyRaphael Photoshop Elements Help 5 07-26-2004 08:18 PM
Mend Tool - Patron Info button error. jimlay Hidden Power Support 6 02-29-2004 01:49 PM


All times are GMT -6. The time now is 04:57 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved