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 - Color Theory and Conversions

Reply
 
Thread Tools
  #31  
Old 02-21-2006, 10:25 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Let's play Connect the Dots.

Sobel
Canny Edge Detection
Gradient
Flow Up and Down
Diplacement Sharpening

Can you see the bigger picture?

Last edited by Stroker; 02-21-2006 at 10:34 PM.
Reply With Quote top
  #32  
Old 02-22-2006, 12:52 AM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
I'm about to jump out of my skin. How about a quick-n-sleazy tutorial? I call this High Pass Masking, but it might be known by other names.

- Start with some photograph
- Copy it and High Pass to taste
- Add an Adjustment Layer > Gradient Map
-- for the G-Map, use Black <> White <> Black
-- start with the white stopper at 50% and tweak from there

What did we just do? We used High Pass for edge detection. The good thing is that it has radius. The bad thing is that it fails in the delta change department. High Pass + delta change = bad! Well, bad for current purposes.

To fill in the holes, all you have to do is complement with regular ol' find edges.

Oh! Did I just say that?

Last edited by Stroker; 02-22-2006 at 01:12 AM.
Reply With Quote top
  #33  
Old 02-22-2006, 05: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 Cameraken
OK, You guys up to mind reading again?

Yes I have read that - and about 50 others in the last couple of days.
The book he quotes, "Numerical recipes in C", is very interesting. I'm getting comfortable with the basic FFT routine, but the 2-dimensional version (which we need here) still scares me a bit.

Actually, I was quite surprised at how (relatively) simple it is. What complicates matters is when you try to get it running faster and faster.

However, our need for bigger and bigger images is just about satisfied. It pretty hard to justify anything bigger than 3000 pixels on each side.
Processing power and memory capacities continue to rise exponentially.
When theses guys started with these techniques they were using "fast" 100MHz computers, but now 1GHz is pretty slow.
Which means that instead of talking of reducing execution times from 5s to 2s, we have something that may take 500ms and reduce to 200ms. Which, for a one-off process, nobody is even going to notice.

Reply With Quote top
  #34  
Old 02-22-2006, 08:43 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Wooha

Hue, Sat and Lum all working fine. Thanks Stroker.


Ken
Reply With Quote top
  #35  
Old 02-23-2006, 02:39 AM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Kudos, Ken.

Now, my way is a bit long-winded. Ralph of Simpel Filter has provided his snippet for HsY > RGB.

Code:
--------------snip-------

              //HsY to RGB - Y hier mit v bezeichnet
      //Scale to float
      hf=6*r/255.0; sf=g/255.0; vf=b/255.0;

      // H is given on [0, 6] or UNDEFINED. S and V are given on [0, 1].
      // RGB are each returned on [0, 1].

      if (sf == 0.0) {rf = vf;  gf = vf;  bf = vf;}
      else {
      i = floor(hf);
      switch (i) {
          case 6:
          case 0: hf = hf;    bf = vf - sf*(0.299 + 0.587*hf); gf = bf
+ sf*hf; rf = bf + sf; break;
          case 1: hf = 2.0 - hf;     bf = vf - sf*(0.587 + 0.299*hf);
rf = bf + sf*hf; gf = bf + sf; break;
          case 2: hf = hf - 2.0;     rf = vf - sf*(0.587 + 0.114*hf);
bf = rf + sf*hf; gf = rf + sf; break;
          case 3: hf = 4.0 - hf;     rf = vf - sf*(0.114 + 0.587*hf);
gf = rf + sf*hf; bf = rf + sf; break;
          case 4: hf = hf - 4.0;     gf = vf - sf*(0.114 + 0.299*hf);
rf = gf + sf*hf; bf = gf + sf; break;
          case 5: hf = 6.0 - hf;     gf = vf - sf*(0.299 + 0.114*hf);
bf = gf + sf*hf; rf = gf + sf;
          }
      }

      //Scale to int
      k1=rf*255;
      k2=gf*255;
      k3=bf*255;
------------------
It's a bit more elegant and is a bit more accurate.

For the most part, I'm going to bow out for now. But I will watch for questions and things that tickle my fancy.
Reply With Quote top
  #36  
Old 02-23-2006, 09:05 AM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Grrr...!

Basic Lab manipulation using FM's built-in polar functions.

Code:
%ffp

supportedmodes: labmode

ctl(0):"Theta",range=(-512,512),val=0,track
ctl(1):"Rho",range=(0,300),val=100,track

ForEveryTile:{
int aa,bb;
int theta,rho;

for(x=x_start;x<x_end;x++){
for(y=y_start;y<y_end;y++){

// grab and normalize to 0
aa=src(x,y,1)-128;
bb=src(x,y,2)-128;

// convert to polar
theta=c2d(aa,bb);
rho=c2m(aa,bb);

// modify polar
theta=theta+ctl(0);
rho=rho*ctl(1)/100;

// back to Cartesian
aa=r2x(theta,rho);
bb=r2y(theta,rho);

// output normalized to 128
pset(x,y,1,aa+128);
pset(x,y,2,bb+128);

}} // y x

return true;
} // for every tile
Reply With Quote top
  #37  
Old 02-24-2006, 09:26 AM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Emboss a bit heavy on precision. If you do it integer style, it's much faster.

Code:
%ffp

ctl(0):"Angle",range=(-180,180),val=0,track
ctl(1):"Height",range=(0,40),val=5,track
ctl(2):"Amount",range=(0,300),val=100,track

supportedmodes: rgbmode

OnFilterStart:{
setZoom(1);
set_edge_mode (3);
return false;
}

ForEveryTile:{
int x,y,z;
int v1,v2,final;
float angle,gx,gy;
float pi = 3.14159;

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

angle=pi*ctl(0)/180.00;
gx=fcos(angle)*ctl(1)/5.0;
gy=fsin(angle)*ctl(1)/5.0;

v1=iget(x+gx,y+gy,z,0,3);
v2=iget(x-gx,y-gy,z,0,3);

final=(v1+(255-v2))/2;
final=128+(128-final)*ctl(2)/100;
pset(x,y,z,final);

}}} // x y z

return true;
} // for every pixel

Last edited by Stroker; 02-24-2006 at 09:41 AM.
Reply With Quote top
  #38  
Old 02-27-2006, 05:53 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
I adore the subject of desaturating. What I don't like is Channel Mixer for desaturating. IMHO, CM is poor for desaturating because it's so one directional.

Here is a variation of Channel Mixer specifically for desaturating.
- not in the code, but I call it Mono Mixer
- Subtract is inverted and works like Multiply
- Substrate is like Constant in CM

Use it wisely.

Code:
%ffp

ctl(0):standard,"Substrate",range=(-226,256),val=0,pos=(280,5),track

ctl(1):standard,"R",range=(-200,200),val=33,pos=(260,25),track
ctl(2):combobox(vscroll,extendedui),"Add\nSubtract\nLinear Light",val=0,pos=(390,23),size=(55,80),action=preview

ctl(3):standard,"G",range=(-200,200),val=33,pos=(260,55),track
ctl(4):combobox(vscroll,extendedui),"Add\nSubtract\nLinear Light",val=0,pos=(390,53),size=(55,80),action=preview

ctl(5):standard,"B",range=(-200,200),val=33,pos=(260,85),track
ctl(6):combobox(vscroll,extendedui),"Add\nSubtract\nLinear Light",val=0,pos=(390,83),size=(55,83),action=preview

supportedmodes: rgbmode

ForEveryTile:{
int x,y;
int r,g,b;
float addr,addg,addb;
int final;

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);

addr = addg = addb = 0;

switch(ctl(2)){ // R
case 0: // add
addr=(float)r*(float)ctl(1)/100.00;
break;
case 1: // subtract
addr=(255.00-(float)r)*(float)ctl(1)/-100.00;
break;
case 2: // linear light
addr=((float)r-128.00)*(float)ctl(1)/200.00;
break;
} // R switch

switch(ctl(4)){ // G
case 0: // add
addg=(float)g*(float)ctl(3)/100.00;
break;
case 1: // subtract
addg=(255.00-(float)g)*(float)ctl(3)/-100.00;
break;
case 2: // linear light
addg=((float)g-128.00)*(float)ctl(3)/200.00;
break;
} // G switch

switch(ctl(6)){ // B
case 0: // add
addb=(float)b*(float)ctl(5)/100.00;
break;
case 1: // subtract
addb=(255.00-(float)b)*(float)ctl(5)/-100.00;
break;
case 2: // linear light
addb=((float)b-128.00)*(float)ctl(5)/200.00;
break;
} // Bswitch


final=ctl(0) + addr + addg + addb;

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
  #39  
Old 02-28-2006, 06:58 AM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
I like the last one Stroker.

Converting from colour to Black and White can be controversial. I read your “Fighting the Status Quo”
With many pictures it doesn’t seem to matter which method is used but with others it can make a big difference.
I particularly like one method (which I think was yours)

* create a new blank Layer on top of your Background
* Fill the new Layer with 50% Grey
* Change the new Layer Blending to Color (or Saturation)

This code gives a lot more control. It's going to need some practice.
Linear Light = Add/Subtract using 128 as the mid-point

Mono Mixer is definitely going in my toolbox.

Thanks Again.

Ken.
Reply With Quote top
  #40  
Old 02-28-2006, 07:33 AM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Ken, you tickle me. Fighting the Status Quo is one of my favorites. I've gotten into some heated arguements over that one. Oh, the irony.

Maybe one of these days I'll wage war again. Show you guys and gals a few uber tricks, and maybe have a chat about contrast while we're at it.

Contrast: to set in opposition in order to show or emphasize differences.

Something to think about - and very relevant when it comes to desaturating.
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
Color Space conversions Reimar Photoshop Elements Help 4 01-16-2004 06:58 AM
Batch Raw conversions in PS CS okplayer Software 0 12-19-2003 01:03 PM


All times are GMT -6. The time now is 09:30 AM.


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