What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

My first public plug: Level3


Stroker

Power User
Messages
428
Likes
0
Still dinking around with junk.

Long story short: I was getting tired of doing this the long way and decided to make my own plug to do my grunt work in a way that I like. Filter Meister ahoy.

It's primary function is to desaturate using L from Lab. Apparently Photoshop does this a little bit different than from what I've been able to find. With a little trial-n-error, I managed to get the error down to 15%. Even then, the % error occurs when Sat is around 75% for most Hues. I find this acceptable and haven't bothered with more detective work.

The desat tweaks are very similar to Levels, but with my own personal twist.
There are 4 sliders:
1. Black
2. Low Gray
3. High Gray
4. White

Black and White operate like in Levels for setting the black point and white point. However, Low Gray and High Gray 'split' the grey slider like in Blend If. Any value that falls between Low and High will be 128, then the rest is linearly interpolated to the appropriate black or white points.

Rather than spend time with a better over-all interpolation scheme, I went with order of precidence. Also didn't bother with error checking in this area. That is, you can move the sliders around more than you should be able to and the results will be funky if you move the sliders out of order, so to speak.

Save As to directory of your choice.
When fire up PS, should show Filter > Tech Slop > Level3.

Level3.8bf

Win XP SP1
PS 7
and it works dandy for me.
No idea for Win XP SP2 or PS CS.

My uses? Primarily for my own wallpapers.
I have my own set of rules that I follow for wallpapers, and Level3 takes care of a lot of my rules.

For just messing around, it's kind of fun to use Level3 to grunge it up real quick.
Drop a bunch of photos into the same doc, Level3 them, then mess with blending modes. Mostly grey-centric modes like Hard Light, but whatever.

Still getting the hang of this stuff. For example, I still have to figure out how to make the preview a little bit bigger. Once I get that ironed out and a few other little things, I'll have even more junk to toss around. For example, desat based on L (Lab) and the 6 major hues with tweak-arific weights.

Note: So far, one person has reported that Level3 does work with PS CS and WinXP SP2.
 
Are filter meister plugs compatible with mac?
works also for me, but I've got the same config as yours...
I tried as you said: copied the layer, ran level3, got the channels as selection, trashed layer, and added hue/sat layer to desaturate... the best effects are there for me when inverting the mask.

So maybe that an invert button would not be overkill?
 
Pierre, it doesn't appear in the filter menu on Mac so I guess it is not compatible.
 
Isn't there a conversion utility somewhere? only for filter meister plug-ins?

Crapola, looks like FM produces PC only code... but if could export to filter factory, and plugin commander can make mac code out of the PC FF one... but maybe not macosX code :C
 
If someone on a Mac wants to try to convert the FM code to FF, I'm willing to e-mail it.
I know that FM can use FF code, but I can't really say how easy it is to go the other way.

Splitting the grey.
I crack me up.
 
I'll give it a bash if you like. I have Filter Factory lurking about somewhere. I'll need to trawl for it first.
Is there anything else I might need?
 
Congrats Stroker :perfect:


Cant code my way out of a paper bag myself [doh]



OT but I got a copy of Nik Color efx Pro2 with my Intuos 3 tablet,its not bad at all,the sunshine filter is most impressive.
 
Rantin, I'll clean up the code a little bit and e-mail it to you.
I'm a bit burned on code right now, so I'm going to take a little bit of time away before I send.
 
Any time you like Stroker. No problem.

Stu, is that the Graphire 3 you have your mitts on? How do you rate it?
I was thinking of replacing my old Wacom 1212 A4 as it only runs on OS9.
 
Hi Al

No Intuos 3.It has keys as in buttons on it,which is perfect for me for 3d,I use my pen as opposed to a mouse more.The 3 had double the amount of lpi for resolution and also a keystrip which you can set to brush size or zoom or scroll etc,and you just run your finger up and down it to zoom in and out or change size of your brushes.The brushes do seem a little more fluid to me with painting and the prefs control window is now better also,but if it was not for the keys I would not have upgraded.


Oh ya and for those of us in the Asia Pacific region,the 6 x 8 now comes with the 5 button mouse as well,not like previously where it did in the USA and didnt in the Asia Pacific region.
 
Al, it is really a must have! I played with it at the photokina, and I'm already looking at my intuos 2 with a different eye...
 
Long story short, here is the code:
Code:
%ffp

Title:"Level 3"  
Category:"Tech Slop"  
Author:"JLHalmich"  
Copyright:"none"  
Description:"This filter allows the user "  
            "to adjust the black point, "  
            "white point, and split the grey."

Dialog:color=lightgray

// controls
ctl(0):"Black",val=28,size=(*,6),pos=(225,32),fontcolor=black,Range=(0,255),val=51
ctl(1):"Low Gray",val=201,size=(*,6),pos=(225,42),fontcolor=black,Range=(0,255),val=102
ctl(2):"High Gray",val=0,size=(*,6),pos=(225,52),fontcolor=black,Range=(0,255),val=153
ctl(3):"White",val=0,size=(*,6),pos=(225,62),fontcolor=black,Range=(0,255),val=204


ForEveryTile:{

// declares
// several are not used
double rVal, gVal, bVal;
double xVal, yVal, zVal;
double lVal, aVal;
double fX, fY, fZ;
double tVal;
double temp;
int fVal;

// loop to run through the pixels
for (y= y_start; y < y_end; y++){
if(updateProgress(y,y_end)) abort();
for (x = x_start; x < x_end; x++){

// have to convert to Cie XYZ first
  rVal = (double) src(x, y, 0);
  gVal = (double) src(x, y, 1);
  bVal = (double) src(x, y, 2);

  yVal = 0.212671 * rVal + 0.715160 * gVal + 0.072169 * bVal;
  yVal /=  255.0;

// using Y, calculate L
// the numbers used are not the only set (same for above)
// with current numbers, error is under 15% for most
  if (yVal > 0.008856){
      fY = pow(yVal, 1.0 / 1.3333);
      lVal = 116.0 * fY - 16.0;
    } else {
      fY = 7.787 * yVal + 16.0 / 116.0;
      lVal = 903.3 * yVal;
    }

// scale the L
// a bit redundant, but left in for debug purposes
lVal = lVal * 2.55;
tVal = lVal;

// final greyscale value
fVal = tVal;

// interpolate the output using conditionals to divide the ranges

// black
if (tVal <= ctl(0)) {fVal=0;}

// white
if (tVal >=ctl(3)) {fVal=255;}

// gray
if (tVal >= ctl(1)){
if (tVal <=ctl(2)) {
fVal = 128;
}
}

// low grey
if (tVal >= ctl(0)){
if (tVal <= ctl(1)){
temp =  ((tVal - ctl(0)) / (ctl(1) - ctl(0)) * 128);
fVal = temp;
}
}

// high grey
if (tVal >= ctl(2)){
if (tVal <= ctl(3)){
temp =  ((tVal - ctl(2)) / (ctl(3) - ctl(2)) * 128) + 128;
fVal = temp;
}
}

// output
  pset( x, y, 0, fVal);
  pset( x, y, 1, fVal);
  pset( x, y, 2, fVal);


}}

return true;

}
 

Back
Top