![]() |
| |||||||
| Software Photoshop, Paintshop Pro, Painter, etc., and all their various plugins. Of course, you can also discuss all other programs, as well. |
| | Thread Tools |
|
#91
| ||||
| ||||
| 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? |
|
#92
| ||||
| ||||
| 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. |
|
#93
| ||||
| ||||
| Instead of this Code: black=min(cyan,min(magenta,yellow)); Code: black=min(cyan,min(magenta,yellow)) * 0.85; 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:
Sure is fun, isn't it? |
|
#94
| ||||
| ||||
| 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. |
|
#95
| ||||
| ||||
| 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:
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. |
|
#96
| ||||
| ||||
| 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. |
|
#97
| ||||
| ||||
| 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
|
|
#98
| ||||
| ||||
| 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? |
|
#99
| ||||
| ||||
| 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 |
|
#100
| ||||
| ||||
| 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. |
|
#101
| ||||
| ||||
| Yeah, I've been slacking lately all around. So much junk to do. - more High Pass tutorials - extracting difference tutorials - variable frequency tutorials (variable medium frequencies rock) - several filters to polish as a direct result of this thread - I figured out how Photoshop handles hue and sat in Lab mode so Lab filters can be made PS friendly - playing with several ideas for flesh tweaking - new water softner to install - dishes and laundry to do It is possible to RGB > CMYK the way Photoshop does it. You will have to get into ICC and junk to do it. Color dot Org? I'm not entirely sure, but I do know it's not a journey I don't want to take. |
|
#102
| ||||
| ||||
| The more I read on CMYK the more I realised it was dependant on ICC profiles. And I don’t want to get into that stuff either. I read the new tutorials. I see you put the Silly Difference Trick in there. I was amazed when I first saw that used at PST and I downloaded the instructions from the Asylum. There has been a lot of discussion recently regarding saturation changes with blending modes (dodge and burn) I have found that a Select All > Copy Merged > Paste Then set blending mode to Luminosity seems to work OK. (Turning off the adjustment layers) Thanks for the new Tutorials Stroker. Next Project. My next project is to try to simulate the Healing Tool. I would like to get the results of the healing tool without having to stamp my way all over the picture. I have scoured the web for a formula but have had no success. This is what I usually do. Create a 50% grey layer and add noise matching the photo. I then use this as my source to heal onto the picture. It would be nice to do this with FM because it is quite time consuming. It would also need a radius (Or brush size) slider. It seems to involve a layer of noise (matching the source) but taking the luminosity of the original somehow. I have found the Perlin noise command implemented by Ron Chambers http://groups.yahoo.com/group/FMML/message/707 Quote:
This feature should be implemented but there is nothing in the Wiki (As usual) and I’m not sure what to put into the brackets. But I get a Symbol ‘perlin’ Undefined error. So maybe this was never implemented. There is noise code here http://freespace.virgin.net/hugo.eli...s/m_perlin.htm Quote:
So it looks quite easy to make my own. But I am not sure how the healing tool uses this. Ken. |
|
#103
| ||||
| ||||
| Perlin Noise is fun. You can already do it with Photoshop's stock tools, or even FM. There are two main things that define Perlin Noise: pseudo-random and interpolation. Now, pseudo-random really matters when you are into animating the texture. For the vast majority of 2d work, don't really need pseudo-random. The interpolation for PNoise is bi-cubic, sometimes smoother and sometimes not. Armed with that and some sub-pixel savvy, we can hack PNoise in Photoshop. - New document and fill with 50% grey. - Filter > Noise > Add Noise to taste. - Rectangular Marque and select a small square. - Copy and paste small square to new layer. - Preferences and make sure interpolation is set to Bi-Cubic Smoother - On the small rectangle layer, Edit > Transform > Free Transform and make it huge. Once you commit the Free Transform, watch the magic as Bi-Cubic Smoother kicks in. Tada. Instant Perlin Noise. To do this with FM, use iget(). Fill one of the buffers with random noise, then use iget() to sample sub-pixels. I might have a working sample in my FM archives somewhere. BBL |
|
#104
| ||||
| ||||
| Okay, here is my first attempt at PNoise using iget(). Code: %ffp
ctl(0): "Size",Range=(2,64),Val=32
ctl(1): "Seed",Range=(1,100),Val=50
ctl(10): combobox(vscroll),action=preview, color=#FFFFFF,fontcolor=#0000ff,
pos=(325,40),size=(70,200),
text="Nearest Neighbor\nBisquare\nBicosine\nBilinear\nBicubic",val=4
ctl(100):STATICTEXT, pos=(325,70),"", fontcolor=black
ForEveryTile:
{
int x,y,beginsizex,beginsizey;
int finalvalue;
float p1,q1;
beginsizex=(X*1/ctl(0));
beginsizey=(Y*1/ctl(0));
rst(ctl(1));
for (y=0; y<beginsizey+1; y++){
for (x=0; x<beginsizex+1; x++){
tset(x,y,0,rnd(0,255));
}//x base
}//y base
for (y=0;y<Y;y++){
for (x=0;x<X;x++){
p1=(float)x*beginsizex/X;
q1=(float)y*beginsizey/Y;
finalvalue=iget(p1,q1,0,1,ctl(10));
pset(x,y,0,finalvalue);
pset(x,y,1,finalvalue);
pset(x,y,2,finalvalue);
}//end x
}//end y
return true;
}
Man, and that's not even getting into fractal or turbulent noise. When will it end? I adore the Silly Difference Trick. While it is mostly a bauble, the derived techniques are very cool. Maybe tonight I'll toss another one or two up after I get some dishes done. I'm not exactly sure what the Dodge & Burn thing is, but I have my suspicions. If it's what I think I think it is, maybe I'll toss some of my notes out for ya'll. It's basically selectively lightening and darkening by painting, right? |
|
#105
| ||||
| ||||
| Stroker Quote:
The latest threads are here http://www.retouchpro.com/forums/non-retouchpro-resources/13350-visual-reference-dodge-burn-tech.html And especially Edgeworks reply here http://www.retouchpro.com/forums/photo-restoration/13455-new-layer-50-grey-overlay.html I have not had chance to try the code yet. I will play with it tomorrow. Ken. |
|
#106
| ||||
| ||||
| Stroker Wow! That code is brilliant. It’s very interesting to see the different interpolation methods in action. And it also shows how clouds can be made from noise. It’s even a good background maker. (I just added R,G,B Checkboxes to get coloured effects. It really needs to be changed to be run three times, once for each channel) Iget is a very powerful command. Interpolation methods: 0 for nearest neighbor (no interpolation), 1 for bisquare, 2 for bicosine, 3 for bilinear and 4 for bicubic. The noise is quite large compared to PS. 2 on this scale is equivalent to about 120 on PS noise filter scale. Ken. |
| Thread Tools | |
| |
| | ||||
| 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 |