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 - Gray Map Filter

Reply
 
Thread Tools
  #1  
Old 03-30-2006, 01:56 PM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
ok, i took the plunge and installed FM. i decided it wasnt very fair to just ask for various filters from others and do nothing myself, especially since retouchpro is a learning site. i installed the beta 7 version and it seems to be functioning properly in psp 10. and since it came with several sourcecode files i loaded one of these up in FM and compiled it. functioned just fine, i guess.

i'm also starting to read the various 'getting started' manuals, but manuals often dont answer questions in the order one has them. so, here's my first question. when you compile an ffp you get the filter in a working form immediately. but, can you save these out as .8bf's and not have to compile them each time when you want to use one? (yup, complete newb here. i'm guessing you either 'make' or 'save', but like i say, i havent gotten that far in the manual yet).

and Ken, i dont want ANY feathering. so, that's not needed at all. basically, all i want is a hue map in gray scale, preferably with 32 ranges of 8 grays each with a slider that would go from 0 to 255. that's it. the feathering itself is done by adjusting any given range close enough to another to do its own feathering/blending. each slider would start with a given, fixed range as its base range. move that given slider and only that range of CURRENT grays in the image would change. and, they would move as grays, i.e. 16*16*16 would keep each channel at the same relative value to the other channels. so, 16*16*16 would move to 17*17*17 and so on, and not something like 17*19*21.

oh, and i'd like it to be able to also move each range in the alpha channel as well so that you could take any range down to 0 opacity.

if 32 ranges is too much, then 16 and if 16 is too much, then 8.

here's the current desired purpose of this filter. in a black and white image that is badly messed up as far as bleeding, fading, corruption or actual damage, you often see something like a black splotch where obviously it shldnt exist. with the gray map filter you could move just that black splotch up to a gray that it shld be without having to clone, push, stamp, heal, or anything else. we've seen some images on retouch that are covered with 'white dustings' and some that are blotchy with grays or black all over the image, but not consistently but that obviously arent meant to be there. if one could either do the whole image at once with the gray map or make a selection on an area and do just that area and then move a gray slider to correct the splotchiness to a nearer gray, that would be great. obviously, the move gray ranges you had to work with, the finer you could correct the image. ideally, you would have 256 ranges for each channel with each having alpha channel opacity/transparency control, but that seemed a bit ambitious and possibly not even necessary.

i've had very good luck by doing all this manually so far. but it's slow, cumbersome and ram intensive doing 8 gray ranges, each as its own layer with its own hue/sat adjustment layer in a group.

if it would help that i post an example image or two of what i've been trying to correct, i'd be happy to do so.

and thanks for looking, ken please, continue. like i said, i installed FM and am looking at the docs, but this may take a while. or, if you want to simply help me do this, that's fine also. just bear in mind that my newbiness may be exasperating to one and all

craig
Reply With Quote top
  #2  
Old 03-30-2006, 07:11 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Hi Craig.

It’s nice to see you here.
It looks like you have already found how easy FM is to write a simple filter.

Your idea of ‘Bands’ is OK but think about 2 sliders instead. You could have one slider to set the mid starting point and another to set the range. This gives an infinite number of bands.

Try this code in FM

Code:
%ffp

ctl(0):standard,"Mid",range=(0,255),val=128,track
ctl(1):standard,"Range",range=(1,50),val=1,track
ctl(2):standard,"Adjust",range=(0,255),val=128,track

R,G,B: (i>=ctl(0)-ctl(1)&&i<=ctl(0) +ctl(1))? i+ctl(2):i

Let’s say you wanted to Brighten/Darken the pixels in the range 100 to 120
Set the ‘Mid’ Slider to 110 (mid point)
Set the ‘Range’ to 10 (10 each side of 110)
Now adjust the brightness with the ‘Adjust’ slider

I still think this needs a ‘Fader’ as the transition between the selected pixels and the non selected pixels becomes very harsh.

It should give you something to play with.

“My newbiness may be exasperating”
That’s a great new word. Please don’t take my code as perfect as I am not that far ahead of you.

In PS7 this code would not be necessary. PS7 has ‘Replace Color’ Which will do the same thing. Also using curves. The curve can be ‘Pinned’ and only a small area moved.


Ken.
Reply With Quote top
  #3  
Old 03-30-2006, 09:50 PM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
ken,

thanks, but two sliders wont do what i want. i mean it would, but you'd have to apply it many times as you edited other ranges. i want to edit them all in preview and then apply.

as for the feathering, that's fine if it can be done as an optional addition, but otherwise no.

craig
Reply With Quote top
  #4  
Old 03-31-2006, 03:44 AM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
A simple example. Six bands with linear fading using an integar and mantissa trick. Very important that the controls are in order in order for this to work.

I left in some of the checking that I used along the way. Just comment in/out various final formulas to see what's up at those stages with the different variables.

I'll explain this in more detail later. Like after this weekend or something.

Code:
%ffp

ctl(0):standard,"0",range=(-100,100),val=0,track
ctl(1):standard,"51",range=(-100,100),val=0,track
ctl(2):standard,"102",range=(-100,100),val=0,track
ctl(3):standard,"153",range=(-100,100),val=0,track
ctl(4):standard,"204",range=(-100,100),val=0,track
ctl(5):standard,"255",range=(-100,100),val=0,track

ForEveryTile:{
int x,y,r,g,b,avg,final,number;
float workingfloat,weight1,weight2;


for (y=y_start; y<y_end; y++){
//if(updateProgress(y,y_end)) abort();
for (x=x_start; x<x_end; x++){

r=src(x,y,0);
g=src(x,y,1);
b=src(x,y,2);

//avg=(r+g+b)/3;
avg=r*0.30 + g*0.59 + b*0.11;

workingfloat=(float)avg/51.00;
// +0.5 for rounding
number=floor(workingfloat+0.5);

// again, +0.5 for rounding
weight1=(workingfloat+0.5)-number;
weight2=1.0 - weight1;

// checking along the way
//final=number*51;
//final=weight1*255;
//final=weight2*255;

// final weighted value
final=avg + ctl(number)*weight2 + ctl(number+1)*weight1;

// write the values back
pset(x,y,0,final);
pset(x,y,1,final);
pset(x,y,2,final);

}} // x y

return true;
} // for every pixel
Reply With Quote top
  #5  
Old 04-01-2006, 05:01 PM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
stroker,

ok, that works a charm! thank you!

so, since i wanted more bands to work with and since i think stroker put only 6 to make me work a bit, i added in 10 more bands and saved the thing. it seemed to work ok, though i was getting some odd 'floating/moving' sliders when i would just mouse over them. but, that may be due to not having restarted windows or psp in a while and ram is just getting fragmented a bit.

so, some questions on that code. what does 'track' do? does it take the numerical value in the earlier part of the line and use that as the value? and how is it getting the range of values to alter? i remember seeing 'standard' in the docs, so i'll look that one up.

also, in another piece of code, not stroker's piece here, i ran into 'rv', 'gv', and 'bv' as variables, i would think. but i couldnt find any definition for them in the docs. and they seem to be reserved variables. i tried changing them and got an error message that it basically didnt know what these were now that i changed them. so, what do they stand for and what do they do?

i'm beginning to remember why i never took up code seriously. too many undefined terms and symbols. and the docs just refuse to tell me what i want to know when i want to know it

craig
Reply With Quote top
  #6  
Old 04-02-2006, 02:33 PM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
ok, i had to change one thing here. where i changed the 'divide by 51.00' to '8.00', i had to change this to '8.50' in order to pick up the very highest numbers.

i also checked the original 6 band and it wouldnt pick up the very lows. the line i'm talking about in all of this is: "workingfloat=(float)avg/51.00;" . i suspect if it were '51'.50' it would work.

craig
Reply With Quote top
  #7  
Old 04-02-2006, 04:01 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Thanks Stroker. That works fine. The ‘feather’ has made it into a useful tool.

Craig.
The range 0-50 works for me. (I have also made the ranges bigger)

A quick way to reset the sliders.
Alter the code (add a blank line or a space) and recompile

I don’t know how much of this thread you have read but have you seen post 49 and 50


Ken.
Reply With Quote top
  #8  
Old 04-02-2006, 04:51 PM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
ken,

ok, the low range in 6 gray band does work. i checked it again. apparently, i just didnt detect the change before visually. this time i checked it after applied to the image with the eye dropper and it was fine.

and no, i havent read through much of this thread yet. i did look at them just now from your direction and even saved that one piece of code, but i really am a newbie here and mostly studying the docs and manuals for now to learn some of the basics before trying to jump in with you guys.

i'm afraid i just cant stand to start at the beginning of a manual and read it. i have something i want to do, so i just start looking for the things that can do it and then do them to get what i want. so, i normally hate almost all 'technical' writing. the only technical writer i could ever stand to read was Jim Butterfield when i was trying to learn assembly. and assembly, therefore, is about the only language i have any real affinity for. but that was years ago i was the same way when i tried to learn C. couldnt stomach the book i had. i wanted to DO, not read. so i was jumping all over the place trying to find the things that would allow me to do what it was i wanted to do. eventually, i just got lost. i'm the same way with psp. i just start doing, then read if i cant get what i want. i rarely read first.

what i want in a technical manual is: here's a list of the tools and here's what they do. this is how you work them. and then index the thing by name of tool, what it does, some code references and working examples. i DONT want a conversational explanation starting at the roots and working forward in what the writer thinks i shld do. i want ALL terms WELL defined with working examples and indexed. and i especially want something that is written so anyone can decipher it. a LOT of techinical writing, even stuff written for 'dummies' is WAY over the reader's head. the writer knows his stuff, but he may not know how to communicate that to someone that doesnt. and that's the single biggest error in technical writing.

so, i want more of a reference manual than a technical manual. fine to divide this up into BASICS, MID-LEVEL and ADVANCED or some such scheme, but i just cant stand to read 100 pages of 'technical' and still not get to the part i'm interested in.

my oldest brother writes code. he's very good at it. he knows all sorts of languages, came up through working on mainframes and 'blind coding' (where you had to input the raw code DIRECTLY into the computer. no 'notepad' or 'editors' or anything. you just coded directly into the machine), was directly involved with the y2k scare and preventing disasters and did a LOT of conversions of mainframe to pc. his secret for writing good manuals is, he NEVER writes them himself. he's a coder, not a writer and he just knows too much and would assume too much. so, he writes his programs and then finds someone who knows absolutely NOTHING about the program and has them write the manuals. this works a charm. the newbie has to learn what's there and learn it in his/her terms with his/her current knowledge of the program, which is nothing. so, they have to figure it out just like the end user is going to have to do. and as they do so, they simply write down what they find out. if they have questions, they ask him. it's the most brilliant technical writing technique i've ever heard of.

so, i'm the newbie. so far, i am finding things out. you guys are great. you're my 'brother' and i'm the person who knows nothing. so, i'm progressing by doing something. when i hit a stop, i ask here.

hehe, ok, sort of got off on a tangent there. i think i did see something in the FM docs about making a reset. i'll do some more reading.

craig
Reply With Quote top
  #9  
Old 04-03-2006, 01:49 AM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
lol, i screwed something up. i'll have to fix it tomorrow. too tired now.

craig
Reply With Quote top
  #10  
Old 04-03-2006, 01:23 PM
Craig Walters's Avatar
Craig Walters Craig Walters is offline
Senior Member
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,786
Blog Entries: 4
ok, so today is tomorrow. to make that program work, for now, just rem out these lines:
Code:
{
  if  (ctl(72)) setCtlVal(0, 0),setCtlVal(1, 0),setCtlVal(2, 0),
setCtlVal(3, 0),setCtlVal(4, 0),setCtlVal(5, 0),setCtlVal(6, 0),
setCtlVal(7, 0),setCtlVal(8, 0),setCtlVal(9, 0),setCtlVal(10, 0),
setCtlVal(11, 0),setCtlVal(12, 0),setCtlVal(13, 0),setCtlVal(14, 0),
setCtlVal(15, 0),setCtlVal(16, 0),setCtlVal(17, 0),setCtlVal(18, 0),
setCtlVal(19, 0),setCtlVal(20, 0),setCtlVal(21, 0),setCtlVal(22, 0),
setCtlVal(23, 0),setCtlVal(24, 0),setCtlVal(25, 0),setCtlVal(26, 0),
setCtlVal(27, 0),setCtlVal(28, 0),setCtlVal(29, 0),setCtlVal(30, 0),
setCtlVal(31, 0),setCtlVal(72,0);

     return false; }
apparently, i have yet to understand braces { } and how they work. or maybe it's the if statement syntax, or maybe the (ctl(72) ... lol. or maybe just most of it.

and yes, i know, i could have, should have used a for statement for all those setCtlVal's. but, i'm not there yet. havent studied those yet and i think i'd run into the same syntax problems i'm having with the 'if'.

and Ro,
Quote:
Craig, this is your big chance! Go to the FM site (http://www.filtermeister.com/) , select Documents, then FilterMeister Wiki.
put up or shut up, ay? lol. ok, point taken

yeah, not initialized in the code sense, so, ok.

and re the variables, reserved... got it. ints... got it. floats, got it.

and this:
Quote:
No, actually it's exactly the other way round. These are the relative weights that our eyes attribute to the R, G, B channels. Thus if we set up this mix (30/59/11) of the three channels the result corresponds to the "luminosity" that we (humans) see. Like stroker said about Photoshop luminosity plus... JPG images have the Luminosity stored separate to the colours - guess the R/G/B percentages used!
that have something to do with the rods anc cones in the eyes? at any rate, that's kinda interesting. never seen that before.

Quote:
This Luminosity stuff exists only in our heads. In Nature there is just a mixture of different wavelengths, nothing separated into greyscale / Colour information.
yup. understood. i also understand digital pretty well and even the various color spaces, lab, cmyk, etc. that i work mostly in rgb is just a simplification on my part. and i've also been contemplating a new color space based more on the exact light spectrum. i find most of these color spaces sort of novelties, including rgb. digital tends to skew the whole mess, not that i mind that much, but is a warping of the true light spectrum. but, that's for much later on

and thank you for the code. you may have noticed i didnt end up using it. i did put it in there, but remmed it out when i found that other stuff. but, your code got me looking into that area. so, thanks i left it in there cause i think there's still some things i may use from it.

ok, back to the code. the last bit i entered is that bit about resetting all the sliders to 0. that bit of code that does that is what i said to rem out, above. if you use my code as is, you'll notice that the reset does work. it will reset everything to 0, but the rest of the code doesnt work. lol. the sliders no longer do anything. so apparently, i'm constantly resetting to 0, no matter what. so if someone could show me the error of my ways, i'd appreciate it.

craig
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
Filter Forge has been officially released! Craig Walters Software 2 03-06-2007 11:09 AM
FilterMeister - Degrunge Filter byRo Software 17 09-04-2006 03:47 PM
Filter Forge Doug Nelson Software 77 07-06-2006 03:05 PM
Tutorial: Texturizer Filter tricks DannyRaphael Photo-Based Art 6 07-13-2002 03:13 PM
Colored Pencil filter: Stroke direction options DannyRaphael Photo-Based Art 14 06-11-2002 06:27 PM


All times are GMT -6. The time now is 10:48 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