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
  #91  
Old 04-17-2006, 01:45 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Good show.

CMYK = print
RGB = monitor
Lab = eyeballs

There is far more to this than just code.

Percentage of what?

The answer is in the link you provided.

C = ( C' - K ) / ( 1 - K )

Or even ( 255 - K ).

And that should fix that.

Still one more logic bomb to find.
You are on a roll, Ken.
I have faith.

Consider: what happens when C' == K?
Reply With Quote top
  #92  
Old 04-17-2006, 03:01 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
If it is true that Cyan equals Black?
This would give zero from the formula which it not right.

But again maybe this bit of the formula is wrong. Should the black content not come from the RGB values?

I have been trying to make some sense of this list of converted colours
http://en.wikipedia.org/wiki/List_of_colors

I hope you have some ideas because I can’t.
It seems we may be back to vectors.


Ken.
Reply With Quote top
  #93  
Old 04-17-2006, 03:45 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Instead of this
Code:
black=min(cyan,min(magenta,yellow));
try this instead
Code:
black=min(cyan,min(magenta,yellow)) * 0.85;
On my machine, 85% is pretty close. Not the greatest, but close enough for slop. What that extra *0.85 will do is make sure that no CMY in CMYK will be 0%.

On a related note, the current code does not allow for adding when C = 0%. That is, if C=0%, then C will remain at 0% no matter what. There is a way to fix this, but the *0.85 will take care of it.

The last thing to fix is the percentages of CMY in CMYK.
Instead of 0 to 255 as percent
Needs to be 0 to ( 255 - K ) as percent
For this, you will have to dig into either data types or order of operations. Well, I think order of operations will fix it. But I do know data types will.

Once you get that, your custom filter should be close enough.

Quote:
It seems we may be back to vectors.
Vector can be a variety of things, so to speak. If you look at the mathematical definition(s) of vector, you should see how it can apply to a wide range of things - not just vector as we've used it. Well, not used the word vector, but how we used vectors themselves.

Sure is fun, isn't it?
Reply With Quote top
  #94  
Old 04-18-2006, 02:03 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Yes. It’s great fun.
It sound like you have not looked at CMYK in the past. So this may be something new for you as well.

I’ve added the 0.85 but I can’t see any improvement because I am still looking at a negative image. Have you added something else? Or do I still need 255-K

data types or order of operations
If I understand this right. Are we looking at some sort of lookup table (fscanf)?


Ken.
Reply With Quote top
  #95  
Old 04-18-2006, 03:08 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
Kind of new but kind of not. I do understand CMYK, but I'm not really familiar with the nuances of working with CMYK.

Check this out. Back in post #250, this little bit is in the code:
Quote:
// no need for this
//range=255-black;
I put that in way back when because I knew there would eventually be a need for it. Kind of knew to me, but sometimes I am that smart. Heh. :toot toot:

Order of operations has to do with with order in which forumals are done. For example, there is a difference between X*Y/100 and X/100*Y. This is *especially* important if you are working with integers.

If you are seeing a negative image, then something is upside-down or inverted or something. I'll look at the last code you posted. If you are working newer code, post it.
Reply With Quote top
  #96  
Old 04-18-2006, 03:29 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
I just took a look at your "RGB and CMYK Channel Mixer". I think you have a fundamental problem. That being that RGB is additive and CMYK is subtractive. They don't exactly go in the same direction as it were.

Consider
RGB(0,0,0) = pure black
CMYK(0,0,0,0) = pure white

If your starting point is black and everything is 0, then you can't exactly add more black. Right?

You will have to do some un-inverting. Or re-think your starting point and how you want to mix the channels. If you add more cyan, do you want it to brighten or darken?

Try this in your mixer:
Code:
// get k or black
black=min(cyan,min(magenta,yellow)) *0.85;

// subtract black
// range 0 to 255 ---> range 0 to 100
cyan=255-cyan-black;
magenta=255-magenta-black;
yellow=255-yellow-black;

// Scale values
out=(red*ctl(0)/100)+(green*ctl(1)/100)+(blue*ctl(2)/100);
out=out+(cyan*ctl(3)/100)+(magenta*ctl(4)/100)+(yellow*ctl(5)/100);
out=out-(black*ctl(6)/100);

Last edited by Stroker; 04-18-2006 at 03:35 PM.
Reply With Quote top
  #97  
Old 04-19-2006, 02:31 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
Hi Stroker.

I added your code in (and a bit of my own)
My idea originally was that I could build a channel mixer where I could mix Red and Cyan. Or extract the Yellow channel for example.

I have added ‘inverts’ to the channels so that I can do both the above.

My current code is attached.

All suggestions/Corrections/Improvements are welcome.

In the Invert CMY Section. I feel like I’m extracting black twice but your code seems to work better than
if (ctl(9)==1) (yellow=255-yellow);
Which is what I would have written

Ken.




Code:
%ffp


Title :"RGB and CMYK Channel Mixer"

ctl(0):standard,"Red",range=(0,100),val=30,track 
ctl(1):standard,"Green",range=(0,100),val=59,track
ctl(2):standard,"Blue",range=(0,100),val=11,track
ctl(3):standard,"Cyan",range=(0,100),val=0,track
ctl(4):standard,"Magenta",range=(0,100),val=0,track
ctl(5):standard,"Yellow",range=(0,100),val=0,track
ctl(6):standard,"Black",range=(0,100),val=0,track
ctl[7]: CHECKBOX, "Invert Cyan",pos=(380,90)
ctl[8]: CHECKBOX, "Invert Magenta",pos=(380,100)
ctl[9]: CHECKBOX, "Invert Yellow",pos=(380,110)
ctl[10]: CHECKBOX, "Invert Black",pos=(380,120)
supportedmodes: rgbmode

ForEveryTile:{
int x,y,red,green,blue,range;
int black,cyan,magenta,yellow;
int out;

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

// grab values  
red=src(x,y,0);
green=src(x,y,1);
blue=src(x,y,2);

cyan=255-src(x,y,0);
magenta=255-src(x,y,1);
yellow=255-src(x,y,2);

// get k or black
//black=min(cyan,min(magenta,yellow));
black=min(cyan,min(magenta,yellow)) * 0.85;


// subtract black
// range 0 to 255 ---> range 0 to 100
cyan=(cyan-black)/2.55;
magenta=(magenta-black)/2.55;
yellow=(yellow-black)/2.55;

// Invert CMY
if (ctl(7)==1) (cyan=255-cyan-black);
if (ctl(8)==1) (magenta=255-magenta-black);
if (ctl(9)==1) (yellow=255-yellow-black);
if (ctl(10)==1) (black=255-black);

// Scale values
out=(red*ctl(0)/100)+(green*ctl(1)/100)+(blue*ctl(2)/100);
out=out+(cyan*ctl(3)/100)+(magenta*ctl(4)/100)+(yellow*ctl(5)/100);
out=out+(black*ctl(6)/100);

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


}}// x, y

return true;
} // for every tile
Reply With Quote top
  #98  
Old 04-20-2006, 03:00 PM
Stroker's Avatar
Stroker Stroker is offline
Senior Member
 
Join Date: Jan 2005
Posts: 370
No more suggests at this time, Mr. Ken. If it's working the way you want, then you should be golden. If you keep messing with FM, maybe some day come back to your mixer and do more things with it in your own way.

You should see the code to some of my first filters. Now that I know more, looking at my old code is almost painful.

One major things has been condensing several smaller filters into one. I used to have one filter for extracting hue, another for extracting sat, and yet another for extracting lum. I eventually put it all together into one.

Another major thing for me has been balance. Do I want a major uber filter for making a variety of greyscale masks? Then use the mask for tweaks once I get back to Photoshop? Or do I want specific greyscale mask with specific tweaks all in one filter?
Reply With Quote top
  #99  
Old 04-21-2006, 02:24 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
I’ve still got the separate hue sat and lum filters installed and I still use them. I did install the three-in-one but I still has to be run three times so there is not that much difference. It’s a shame that FM won’t create new layers.

The channel mixer is never going to be perfect unless we could get Adobes conversion. The one we used is not the same. However it is working of a fashion.
There is some cmy2rgb code here
http://groups.yahoo.com/group/FMML/message/3220
I may try again with this.

I’ve still got loads of ideas I want to code. Several of them are using Deconvolution
I know I can use the convolution filter (As in post 49) But I think I need to do a lot more reading on deconvolution.

I found the code for one of my ideas here
http://groups.yahoo.com/group/FMML/message/2136
I have implemented the changes suggested here
http://groups.yahoo.com/group/FMML/message/2138
I have not got this working properly but PshopLifter has now finished this and is available here
http://home.planet.nl/~ber03728/4N6site/main.htm
There is some interesting stuff there. Roll your mouse over the picture at the bottom of the page. And read the ‘Explaining Colour Deconvolution’ I think you will find it interesting. His link to http://www.couleur.org/ is interesting too.
I have requested His filters.

Ken
Reply With Quote top
  #100  
Old 04-28-2006, 02:44 PM
Cameraken's Avatar
Cameraken Cameraken is offline
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,158
During my searches for FM info I came across several good ‘Ready made’ filters.
And I thought that some were worth sharing here. Have a poke round at these links and you will find more filters.


SF Color Space Converter
This filter converts from RGB to many other Spaces including CMY and LAB. So PSP users can see other spaces without Image Analyzer. (It also converts back and works far better than my attempt)
sf_konverter.zip
Available here.
http://www.simpelfilter.de/en/bildbe...converter.html


Shadow/Highlight.
PSP and PS7 users do not have this but there are several plug-ins which can add this feature
Equaliser by Mehdi. http://www.mehdiplugins.com/english/equalizer.htm
Xpose. http://www.littleinkpot.co.uk/FreePlugins.htm
Luminocity1.0 http://www.sd3.info/pf828/

Jpeg Remover
Topaz DeJPEG
http://www.topazlabs.com/download.html


AAA Filters
Simplify your image for artistic effects.
http://8bf.net/


Here are more links to plug-ins
http://www.mehdiplugins.com/
http://www.redfieldplugins.com/ (Not all free)
http://www.richardrosenman.com/software/downloads/
And, of course, saving the best ‘till last. Stroker’s own site
http://tech-slop.serveit.org/wiki/in...itle=Main_Page



Ken.
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 01:17 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