-
Posts
3,019 -
Joined
-
Last visited
-
Days Won
125
Posts posted by Red ochre
-
-
Here's an attempt using mostly 'Highlight', with secondary colour set to pink, using the 'venus 5 way' setting with the line width quite large to make the flare pentagons.
Lots of layers a few gaussian blurs, graduated layers and adjusting transparency and colour.
I will try to private message you the pdn file - but I'm useless at understanding the forum - so hold your breath!
- just experiment using many layers, running highlight with different settings on each, to try and build up the effect you are after.
-
What's wrong with my 'highlight' plugin?
You could get the effect shown in the link by layering and setting primary colour to red.
-
I hope you enjoy it. - It' fun and simple to use and can give you ideas for alternate colour schemes, but it isn't subtle! - still there are plenty of more 'sane' colour plugins (curves etc.), if you need to fine tune things.
-
Thanks Valkathis and dj1551, for taking the time to reply . Glad you are finding it useful.
-
155 downloads, 600 views, no response - I WIN!
- probably my fault - halfway through posting I received terrible news (my Dad died)- so I just wanted to get off the PC and grieve. So not the greatest intro - And I quite like the silence.
Still, playing around with numbers and silly computer languages is a useful distraction.
I've got an improved version of 'contour' - but when I publish, I will specify 'replies not tolerated' - and probably get some!
Don't want to bring anyone down - but life is short - laugh when you can and when you shouldn't - personally I consider religion the best joke - paint real pictures with oil paint - it hasn't been bettered in nearly 600 years, and although pdn is wonderful, eyes, pencil and brain are still the best way to learn about the world (visually).
However pdn has shown me the beauty of trigonometry - if I'd understood those curves as an adolescent, things would have been different!
Think I've gone off topic here - never mind.
Thanks again for the unsung work and thanks to the others I read and never bother logging in to respond to ;(Barbq, welshblue , etc,etc)
-
Ah.... you got the reference (I didn't want to risk the spelling - French is foreign language to me!).
I'm not sure about a plugin pack - I'm still working on some ideas for new plugins and wonder if keeping separate threads for each may be easier if people have questions.
Would the separate threads be deleted if I rolled the published ones into a new thread? - and would the download limit still allow examples/screenshots?
It is an ambition, but I'm a bit busy at the moment and ideally I'd like to explain the plugins more fully if I published a pack.
So work in progress.
Cheers:D
-
Many thanks for keeping this pdf up to date. It's good to see my plugins included - makes me feel like a real programmer!
I didn't reply earlier because I didn't want to ruin your chances in the 'most read/downloaded - least replied to, competition;)
-
This plugin uses one slider control to quickly produce a large range of psychedelic colour effects. Examples below.
Many thanks to EER for advice and encouragement when I started this plugin.
Tips:
It's fun to use on faces and landscapes and it will work on partially transparent layers such as text layers.
However it needs some graduation to get the full effect, so I'd recommend using my 'tweak transparency' plugin first, if using on plain black text.
If the effect is too strong, then run it on a duplicate layer and experiment with transparency and blend options.
All feedback appreciated. Enjoy!
pschocolour is now in my plugin pack... here's the link:
- 1
-
Thanks for the positive feedback:)
-
Hello, this plugin is designed for use on transparent layers such as text layers or an 'ink sketch' on a transparent background,(where it can thicken the outline).
A blur can be applied, then there are various ways to change the transparency within the maximum and minimum values and the overall transparency.
Additionally you can select which colours to apply to the blur, (best set the primary and secondary colours first).
It can create 'outline', 'bevelled' or 'shadow/halo' type effects, but since it relies on the change created by the blur it does not require text to be selected, as it works on the whole layer.
Tweak transparency is no longer in my plugin pack but is still attached here though.
I hope you enjoy it
23rd August 2011 - I have re-written this plugin.
It is now much easier to blend 2 colours to create some interesting text effects.
-
That looks like the 'effect' you get by changing the 'fill: solid color' button to select a texture - at the top - click on it and scroll down.
Then whatever you paint will be in that texture.
I don't think it's a plugin - but I could be wrong.
-
Oh, so that's what a Gradients' "transparency" mode is.
Anyways, here is my result, a mix of a house covered in ice and a house burning.
I think it could have been better.
That's a really strong, interesting image - I'd love to see both source photos.
The only (minor) suggestion is the top LHS 'ghost' branch, through the blue sky, may be worth removing.
The 2 images have registered together well and the idea and source pictures are stunning.
-
Thanks for the encouraging feedback - it will spur me on to finish some of my other 'beta' plug-ins
-
It's always good to learn!
The main thing is to experiment and teach yourself - and use the tutorials - and get the concept of layers... and understand how to select things.. and different file formats.
I've got an old bundled version of Photoshop - it's very good for text, & comes with loads of pre-made clip art, you'll, (I will) never use.
I recommend trying whatever free graphics programs you can ( If your confident they're safe - virus scan everything).
Gimp is powerful but complicated and a bit awkward on Windows (all just my opinions).
There is freeware (usually quite old) from Serif and trial versions of the latest Adobe stuff. But it's probably better to understand the way various effects are created, I've learned a lot from the tutorials.- And still learning.
Also there are 'vector' type graphic programs - also worth trying .. but different.
If you've got every program on your computer, you may well get mixed up between them - but I'm quite happy to use one program for one thing and one for another.
I love Paint.net because it's a small program giving me the option to download the plug-ins I want, and lately because I can mess about writing plug-ins, (to greater or less success!).
-
Hello, I've made a plugin to render those twinkly highlights you get when a photo is taken towards the Sun, highlights on water or metallic text.
It is also good for space type pictures.
It works on transparent layers, allowing more blend options and uses the primary and secondary colours - so try setting those first, ( a slightly off-white for the secondary gives good results).
Tell me what you think (don't be too cruel, it's the first plugin I've dared to publish!). Enjoy.
Highlight (updated) is now in my plugin pack. Here's the link
- 2
-
It's in 'Evanolds' plug in pack, which is pinned in the plugins section. Once you've unzipped it and put it in the effects folder, it shows up under Effects/distorts/quadrilateral reshape.
- I've used it when trying to unskew photos of real paintings that have been taken from an angle.
Just had a look in my effects folder and I presume the effect is in EOeffects.dll, as I've got the effect but no .dll called quadrilateral reshape!
-
I may have misunderstood but If you want to give the impression of rotating around the vertical axis, through the picture plane, then the "Quadrilateral reshape" plug in is very useful.
-
I have problems with this too. I try to save before using it, as it can crash if the tolerance level is too broad. It probably doesn't actually crash, but life is too short to wait. It would be helpful to have some way of aborting it, once started, too avoid a near infinite hang, allowing you to reset the tolerance to something it can deal with.(2gb dualcore Vista)
-
Thanks for the reply.
Sorry, I still don't understand. I'm reading from the src into an array, then changing the values in the array (to avoid unwanted 'feedback'from refencing pixels that will be changed), then using these new values to write to the dst.
At some stage in that process the plugin is deciding that a single 'line' pixel which is surrounded by 'background' pixels - isn't? (when I can see it is !).
Surely if it wasn't writing to dst along the ROI borders, the image would have either solid horizontal lines or lines of the unaltered src image(colour)?
The process does what it should inbetween these borders and on the borders still manages to 'write' the part-processed image - ie black and white. It just isn't changing it to what it should be from the array.
Black or white (from true, true or false, false in the array) & red if added (false, true), cyan if removed (true, false).
Anyway - thanks for the reply - If you can think of anyway round this or any plugins (with published code), which have overcome this problem, I'd be very grateful.
-
I'm working on the attached plugin (which creates various types of ink outline). The problem I can't solve, is in the 'enhancements' section, where I am trying to remove isolated pixels and add in pixels to fill gaps. I'm doing this by 'looking' at the surrounding pixels - However, I think the rectangle of interest is stopping it seeing around the current pixel when it borders 2 ROIs.
I am testing the plugin by marking line pixels that have been added in, red, and those removed, cyan. If you zoom right in on the attached image you will see where it's going wrong.
I have tried the 'g.clip' code with no effect and really think I need someway of making it consider the whole whole image as 1 ROI to avoid this. Of course it could be due to something else.
I would be grateful for any ideas on how to solve this. Please bear in mind that I'm very new to C# and this is very much a 'beta' version - it will need a lot of tidying up, but I need to sort this problem first.
Many thanks
By the way I think the answer to the question is using a method outside of the render loop - but haven't got back to this yet.
/* =================================================== */ /* */ /* Advanced Beta Ink drawing.cs */ /* (c) 2011 Red Ochre (John Robbins) */ /* */ /* Description: produces various ink outlines */ /* */ /* ========================================== ======== */ // Name: Beta Complex ink drawing // Author: Red ochre (John Robbins) // Submenu: Advanced // URL: http://www.getpaint.net/redirect/plugins.html // Title: Complex ink drawing - 2011 Red Ochre #region UICode byte Amount1 = 0; // detection type|0.darker than blur|1.lighter than blur|2.both (blur)|3.darker by colour (blur)|4.edge detect|5.emboss|6.oil painting|7.relief int Amount2 = 5; // [1,100] blur radius - smoothness OR edge angle OR brush size int Amount3 = -100; // [-256,256] dark / bright threshold byte Amount4 = 0; // outline properties|primary colour|transparent|as original(src)|as detection type(dst)|src greys|dst greys|secondary colour byte Amount5 = 0; // background properties|secondary colour|transparent|as original(src)|as detection type(dst)|src greys|dst greys|primary colour int Amount6 = 765; // [0,765] background if tone above this int Amount7 = 0; // [0,765] background if tone below this byte Amount8 = 6; // enhancements|none|1....by 4|2..... by 8|3....by 20|4... by 36|5.link lines|6.thicken lines byte Amount9 = 1; // presets|normal|test mode (red = added pix. cyan = removed) #endregion void Render(Surface dst, Surface src, Rectangle rect) {// Graphics g = new RenderArgs(dst).Graphics; // this doesn't seem to work as ROI still causes problems // g.Clip = new Region(rect); // comment this code out if(Amount1 == 0 || Amount1 == 1 || Amount1 == 2 || Amount1 == 3){ // Call the Gaussian Blur effect GaussianBlurEffect blurEffect = new GaussianBlurEffect(); PropertyCollection bProps = blurEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken bParameters = new PropertyBasedEffectConfigToken(bProps); bParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount2); blurEffect.SetRenderInfo(bParameters, new RenderArgs(dst), new RenderArgs(src)); blurEffect.Render(new Rectangle[1] {rect},0,1);} if(Amount1 == 4){ // Setup for calling the Edge Detect effect EdgeDetectEffect edgedetectEffect = new EdgeDetectEffect(); PropertyCollection edgeProps = edgedetectEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken EdgeParameters = new PropertyBasedEffectConfigToken(edgeProps); EdgeParameters.SetPropertyValue(EdgeDetectEffect.PropertyNames.Angle, (double)((50 - Amount2) * 1.8)); edgedetectEffect.SetRenderInfo(EdgeParameters, new RenderArgs(dst), new RenderArgs(src)); // Call the Edge Detect function edgedetectEffect.Render(new Rectangle[1] {rect},0,1);} if(Amount1 == 5){// Setup for calling the Emboss function EmbossEffect embossEffect = new EmbossEffect(); PropertyCollection eProps = embossEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken eParameters = new PropertyBasedEffectConfigToken(eProps); eParameters.SetPropertyValue(EmbossEffect.PropertyNames.Angle, (double)((50 - Amount2) * 1.8)); embossEffect.SetRenderInfo(eParameters, new RenderArgs(dst), new RenderArgs(src)); // Call the Emboss function embossEffect.Render(new Rectangle[1] {rect},0,1);} if(Amount1 == 6){// Setup for calling the Oil Painting effect OilPaintingEffect oilpaintEffect = new OilPaintingEffect(); PropertyCollection oilpaintProps = oilpaintEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken oilpaintParameters = new PropertyBasedEffectConfigToken(oilpaintProps); oilpaintParameters.SetPropertyValue(OilPaintingEffect.PropertyNames.BrushSize,(int) ((Amount2 * 8) / 100)); oilpaintParameters.SetPropertyValue(OilPaintingEffect.PropertyNames.Coarseness, 3); oilpaintEffect.SetRenderInfo(oilpaintParameters, new RenderArgs(dst), new RenderArgs(src)); // Call the Oil Painting function oilpaintEffect.Render(new Rectangle[1] {rect},0,1);} if(Amount1 == 7){// Setup for calling the Relief effect ReliefEffect reliefEffect = new ReliefEffect(); PropertyCollection reliefProps = reliefEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken ReliefParameters = new PropertyBasedEffectConfigToken(reliefProps); ReliefParameters.SetPropertyValue(ReliefEffect.PropertyNames.Angle, (double)((50 - Amount2) * 1.8)); reliefEffect.SetRenderInfo(ReliefParameters, new RenderArgs(dst), new RenderArgs(src)); // Call the Relief function reliefEffect.Render(new Rectangle[1] {rect},0,1);} ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor; ColorBgra cp; // current pixel ColorBgra dp; // destination pixel int B, G, R, A, dB, dG, dR, dA,td,ts,lb,lg,lr,la,bb,bg,br,ba,h,w,r; int th = Amount3; int th3 = Amount3/3; int H = rect.Bottom - rect.Top; int W = rect.Right - rect.Left; byte A8 = Amount8; bool[,,]v = new bool[W,H,2]; // hope this is ok. array W by H and true or false * 2 bool l = true; bool b = false; // l = outline = true; b = background = false for (int y = rect.Top; y < rect.Bottom; y++) // LOOP 1 analyze src and put result in array sval { for (int x = rect.Left; x < rect.Right; x++) { h = y - rect.Top; w = x - rect.Left; cp = src[x,y]; B = (int)cp.B; G = (int)cp.G; R = (int)cp.R; A = (int)cp.A; dp = dst[x,y]; dB = (int)dp.B; dG = (int)dp.G; dR = (int)dp.R; dA = (int)dp.A; td = dB + dG + dA;// destination - blurred, edge detected, embossed pixel ts = B + G + R;// source - unblurred pixel th3 = th / 3; if(Amount1 == 0 || Amount1 == 2 || Amount1 == 4 ||Amount1 == 5 ||Amount1 == 6 || Amount1 == 7 || Amount1 == 8) {if(ts < td + th && ts > Amount7 && ts <= Amount6){v[w,h,0] = l;} // if darker (line) then true else v[w,h,0] = b; } if(Amount1 == 1) {if(ts > td - th && ts > Amount7 && ts <= Amount6){v[w,h,0] = l;} // if lighter than blur by amount2 then also true else if (Amount1 == 1){ v[w,h,0] = b;} } if(Amount1 == 2) {if((ts < td + th || ts >= td - th) && ts > Amount7 && ts <= Amount6){v[w,h,0] = l;} // both, if darker (line) or lighter (background)then true else if (Amount1 == 2){ v[w,h,0] = b;} } if(Amount1 == 3) {if((B < dB + th3 || G < dG + th3 || R < dR + th3) && ts > Amount7 && ts <= Amount6){v[w,h,0] = l;} // darker by colour else if (Amount1 == 3){ v[w,h,0] = b;} } v[w,h,1] = v[w,h,0]; } } if(A8 > 0 ) {for (int y = rect.Top; y < rect.Bottom; y++) // LOOP 2 - changes sval entries remove single pixels { for (int x = rect.Left; x < rect.Right; x++) { h = y - rect.Top;w = x - rect.Left; if(h >= 1 && h < H-1) {if(w >= 1 && w < W-1) {if(A8 > 0 ) {if(v[w,h,0] == l && v[w - 1,h ,0] == b && // case 1 - by 4 v[w ,h - 1,0] == b && v[w ,h + 1,0] == b && v[w + 1,h ,0] == b ) {v[w,h,1] = b;}// if line surrounded by 4 background make background if(v[w,h,0] == b && v[w - 1,h ,0] == l && v[w ,h - 1,0] == l && v[w ,h + 1,0] == l && v[w + 1,h ,0] == l ) {v[w,h,1] = l;}}// if background surrounded by 4 line make line if(A8 > 1 ) {if(v[w,h,0] == l && v[w - 1,h - 1,0] == b && // case 2 - by 8 v[w - 1,h + 1,0] == b && v[w + 1,h - 1,0] == b && v[w + 1,h + 1,0] == b ) {v[w,h,1] = b;}// if line surrounded by 4 background make background if(v[w,h,0] == b && v[w - 1,h - 1 ,0] == l && v[w - 1,h + 1,0] == l && v[w + 1,h - 1,0] == l && v[w + 1,h + 1,0] == l ) {v[w,h,1] = l;}// if background surrounded by 4 line make line } } } if(h >= 2 && h < H - 2) {if(w >= 2 && w < W - 2) {if(A8 > 2) {if(v[w,h,0] == l && v[w - 2,h ,0] == b && // case 3 - 20. previous 8 checks & 12 pix perimeter check v[w - 2,h - 1,0] == b && v[w - 1,h - 2,0] == b && v[w ,h - 2,0] == b && v[w + 1,h - 2,0] == b && v[w + 2,h - 1,0] == b && v[w + 2,h ,0] == b && v[w + 2,h + 1,0] == b && v[w + 1,h + 2,0] == b && v[w ,h + 2,0] == b && v[w - 1,h + 2,0] == b && v[w - 2,h + 1,0] == b ) {v[w,h,1] = b;} // make background if isolated line pix if(v[w,h,0] == b && v[w - 2,h ,0] == l && // case 3 - same for sad lonely background pixies v[w - 2,h - 1,0] == l && v[w - 1,h - 2,0] == l && v[w ,h - 2,0] == l && v[w + 1,h - 2,0] == l && v[w + 2,h - 1,0] == l && v[w + 2,h ,0] == l && v[w + 2,h + 1,0] == l && v[w + 1,h + 2,0] == l && v[w ,h + 2,0] == l && v[w - 1,h + 2,0] == l && v[w - 2,h + 1,0] == l ) {v[w,h,1] = l;} // make line if isolated background pix } } } if(h >= 3 && h < H - 3) {if(w >= 3 && w < W - 3) {if(A8 > 3) {if(v[w,h,0] == l && v[w - 3,h ,0] == b && // case 4 - 36. previous 20 checks & 16 pix perimeter check v[w - 3,h - 1,0] == b && v[w - 2,h - 2,0] == b && v[w - 1,h - 3,0] == b && v[w ,h - 3,0] == b && v[w + 1,h - 3,0] == b && v[w + 2,h - 2,0] == b && v[w + 3,h - 1,0] == b && v[w + 3,h ,0] == b && v[w + 3,h + 1,0] == b && v[w + 2,h + 2,0] == b && v[w + 1,h + 3,0] == b && v[w ,h + 3,0] == b && v[w - 1,h + 3,0] == b && v[w - 2,h + 2,0] == b && v[w - 3,h + 1,0] == b ) {v[w,h,1] = b;} // make background if isolated line pix if(v[w,h,0] == b && v[w - 3,h ,0] == l && // case 4 - same for background v[w - 3,h - 1,0] == l && v[w - 2,h - 2,0] == l && v[w - 1,h - 3,0] == l && v[w ,h - 3,0] == l && v[w + 1,h - 3,0] == l && v[w + 2,h - 2,0] == l && v[w + 3,h - 1,0] == l && v[w + 3,h ,0] == l && v[w + 3,h + 1,0] == l && v[w + 2,h + 2,0] == l && v[w + 1,h + 3,0] == l && v[w ,h + 3,0] == l && v[w - 1,h + 3,0] == l && v[w - 2,h + 2,0] == l && v[w - 3,h + 1,0] == l ) {v[w,h,1] = l;} // make line if isolated background pix } } } if(A8 > 4) {if(h >= 1 && h < H-1) {if(w >= 1 && w < W-1) {if(A8 > 4) // case 5 connect lines {if(v[w,h,0] == b && v[w - 1,h ,1] == l && v[w + 1,h ,1] == l){v[w,h,1] = l;} if(v[w,h,0] == b && v[w ,h - 1,1] == l && v[w + 1,h + 1,1] == l){v[w,h,1] = l;} if(v[w,h,0] == b && v[w - 1,h - 1,1] == l && v[w + 1,h + 1,1] == l){v[w,h,1] = l;} if(v[w,h,0] == b && v[w - 1,h + 1,1] == l && v[w + 1,h - 1,1] == l){v[w,h,1] = l;} } // thicken lines case 6 if(A8 == 6) {if(v[w,h,0] == l && v[w,h,1] == l){v[w - 1,h - 1,1] = l;v[w ,h - 1,1] = l;v[w + 1,h - 1,1] = l; v[w - 1,h ,1] = l;v[w + 1,h ,1] = l; v[w - 1,h + 1,1] = l;v[w ,h + 1,1] = l;v[w + 1,h + 1,1] = l; } } } } } } } } for (int y = rect.Top; y < rect.Bottom; y++) // LOOP 3 - sets BGRA values, re-assembles and sends to dst canvas { for (int x = rect.Left; x < rect.Right; x++) { h = y - rect.Top; w = x - rect.Left; cp = src[x,y]; B = (int)cp.B; G = (int)cp.G; R = (int)cp.R; A = (int)cp.A; td = (int)dst[x,y].B +(int)dst[x,y].G + (int)dst[x,y].R;// destination - blurred pixel ts = B + G + R;// source - unblurred pixel lb = 0; lg = 0; lr = 0; la = 255; // set initial line variables to black bb = 255; bg = 255; br = 255; ba = 255; // set initial background variables to white switch (Amount4)// line properties {case 0: lb = PrimaryColor.B; lg = PrimaryColor.G; lr = PrimaryColor.R; la = PrimaryColor.A;break; //line colour = primary colour default black case 1: lb = B; lg = G; lr = R;la = 0;break; //transparent case 2: lb = B; lg = G; lr = R; la = A;break; // as original case 3: lb = dst[x,y].B; lg = dst[x,y].G; lr = dst[x,y].R; la = dst[x,y].A;break; // as blur case 4: lb = (int)(ts / 3);lg = (int)(ts / 3);lr = (int)(ts / 3);la = A;break; // src greys case 5: lb = (int)(td / 3);lg = (int)(td / 3);lr = (int)(td / 3);la = A;break; // dst greys case 6: lb = SecondaryColor.B;lg = SecondaryColor.G;lr = SecondaryColor.R;la = SecondaryColor.A;break;}// secondary colour switch (Amount5)//background properties {case 0: bb = SecondaryColor.B; bg = SecondaryColor.G; br = SecondaryColor.R; ba = SecondaryColor.A;break; //background colour = secondary colour default white case 1: bb = B; bg = G; br = R; ba = 0;break; //transparent case 2: bb = B; bg = G; br = R; ba = A;break; // as original case 3: bb = dst[x,y].B; bg = dst[x,y].G; br = dst[x,y].R; ba = dst[x,y].A;break;//as blur case 4: bb = (int)(ts / 3);bg = (int)(ts / 3);br = (int)(ts / 3);ba = A;break; // src greys case 5: bb = (int)(td / 3);bg = (int)(td / 3);br = (int)(td / 3);ba = A;break; // dst greys case 6: bb = PrimaryColor.B; bg = PrimaryColor.G; br = PrimaryColor.R; ba = PrimaryColor.A;break;}// primary if(v[w,h,1] == {B = bb; G = bg; R = br; A = ba;}//background values if(v[w,h,1] == l) {B = lb; G = lg; R = lr; A = la;}//outline values if(Amount9 == 1 && v[w,h,0] == l && v[w,h,1] == {B = 128;G = 128; R = 0; A = 255;} // if changed line single pixel make cyan if(Amount9 == 1 && v[w,h,0] == b && v[w,h,1] == l){B = 0;G = 0; R = 255; A = 255;} // if changed background single pixel make red // re assemble cp = ColorBgra.FromBgra( Int32Util.ClampToByte(, Int32Util.ClampToByte(G), Int32Util.ClampToByte(R), Int32Util.ClampToByte(A)); dst[x,y] = cp; } } }
-
I also had an error involving SetUpFrontend.exe when installing 3.5.7. I'm attaching the screenshot of the warning - but paint.net seems to still be working o.k.?
Sorry this doesn't help you - but it may help those trying to fix it?
Edit: - I removed the screenshot to save upload space - It's irrelevant now were v3.5.10 too!
-
Hello all, I've attached the dll of the re-written contour plugin. The code should be below.
/* =================================================== */ /* */ /* Contour.cs */ /* (c) 2011 John Robbins (Red Ochre) */ /* */ /* Description: creates contours based on an images luminosity */ /* */ /* ========================================== ======== */ // Name: Contour // Author: Red Ochre (John Robbins) // Submenu: Stylize // URL: http://www.getpaint.net/redirect/plugins.html // Title: Contour - 2011 Red Ochre #region UICode int Amount1 = 25; //[0,100]smoothness (blur radius) int Amount2 = 5; //[1,50]number of contours n double Amount3 = 0.5; //[0.01,1.00]contour/gap ratio ColorBgra Amount4 = ColorBgra.FromBgr(250,250,25); //contour colour byte Amount5 = 0; //contour properties|rainbow|background|transparent|solid colour|shaded across contour|shaded along contour|shade both ways|both ways from source(speckled) ColorBgra Amount6 = ColorBgra.FromBgr(25,25,250); //gap colour byte Amount7 = 7; //gap properties|background|transparent|solid colour|shaded across gap|shaded along gap|shade both ways|both ways from source(speckled)|rainbow #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Call the Gaussian Blur effect GaussianBlurEffect blurEffect = new GaussianBlurEffect(); PropertyCollection bProps = blurEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken bParameters = new PropertyBasedEffectConfigToken(bProps); bParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount1); blurEffect.SetRenderInfo(bParameters, new RenderArgs(dst), new RenderArgs(src)); blurEffect.Render(new Rectangle[1] {rect},0,1); ColorBgra CurrentPixel; int B, G, R, A, tc, tg; double rad = Math.PI * 2; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = dst[x,y]; B = (int)CurrentPixel.B; G = (int)CurrentPixel.G; R = (int)CurrentPixel.R; A = (int)CurrentPixel.A; int n = Amount2; // n = number of contours from slider int bothw = 765/n; // cw + gw (cw = contour width, gw = gap width) int cw = (int)(bothw * Amount3); // contour width as ratio of 'bothw' int gw = bothw - cw; // gap width is the remainder int tv = B + G + R; // tone value from current (blurred) int ts = (int)src[x,y].B + (int)src[x,y].G + (int)src[x,y].R; // ts = source (unblurred) tone value if(Amount5 == 7){tc = ts;} // change tone value to unblurred for speckled option else {tc = tv;} if(Amount7 == 6){tg = ts;} else {tg = tv;} for (int z = 0; z < n + 1; z++) // contour and gap loop { int thresh0 = bothw * z; // thresholds ... gap starts int thresh1 = thresh0 + cw; // thresholds ... gap ends, contour starts int thresh2 = thresh0 + bothw; // thresholds ... contour ends, gap starts double rat = (double)tc / 765; // long ways shading factor double midcont = ((thresh2 - thresh1) / 2) + thresh1 ; // contour mid point double midgap = ((thresh1 - thresh0) / 2) + thresh0 ; // gap mid point double c1, c2; //crossways shading multipliers double f = 2.0; // factor to lighten the bothways shading mode int gB = Amount6.B; int gG = Amount6.G; int gR = Amount6.R; int gA = Amount6.A; // gap colours int cB = Amount4.B; int cG = Amount4.G; int cR = Amount4.R; int cA = Amount4.A; // contour colours // Gap if (tv >= thresh0 && tv < thresh1) {switch(Amount7) {case 0: // background B = (int)src[x,y].B;G = (int)src[x,y].G;R = (int)src[x,y].R;A = (int)src[x,y].A; break; case 1: // transparent A = 0; break; case 2: // solid colour B = gB; G = gG; R = gR; A = gA; break; case 3: // shade across if(tv < midgap) {c1 = (tv - thresh0) / (midgap - thresh0); B = (int)(gB * c1); G = (int)(gG * c1); R = (int)(gR * c1); A = gA;} if(tv == midgap){B = gB; G = gG; R = gR; A = gA;} if(tv > midgap) {c2 = (thresh1 - tv) / (thresh1 - midgap); B = (int)(gB * c2); G = (int)(gG * c2); R = (int)(gR * c2); A = gA;} break; case 4: // shade along B = (int)(gB * rat); G = (int)(gG * rat); R = (int)(gR * rat); A = gA; break; case 5: // both ways if(tv < midgap) {c1 = (tv - thresh0) / (midgap - thresh0); B = (int)(gB * c1 * rat * f); G = (int)(gG * c1 * rat * f); R = (int)(gR * c1 * rat * f); A = gA;} if(tv == midgap){B = (int)(gB * rat * f); G = (int)(gG * rat * f); R = (int)(gR * rat * f); A = gA;} if(tv > midgap) {c2 = (thresh1 - tv) / (thresh1 - midgap); B = (int)(gB * c2 * rat * f); G = (int)(gG * c2 * rat * f); R = (int)(gR * c2 * rat * f); A = gA;} break; case 6: // both from source if(tg < midgap) {c1 = (tg - thresh0) / (midgap - thresh0); B = (int)(gB * c1 * rat * f); G = (int)(gG * c1 * rat * f); R = (int)(gR * c1 * rat * f); A = gA;} if(tg == midgap){B = (int)(gB * rat * f); G = (int)(gG * rat * f); R = (int)(gR * rat * f); A = gA;} if(tg > midgap) {c2 = (thresh1 - tg) / (thresh1 - midgap); B = (int)(gB * c2 * rat * f); G = (int)(gG * c2 * rat * f); R = (int)(gR * c2 * rat * f); A = gA;} break; case 7: // rainbow if(tv <= midgap) {c1 = (tv - thresh0) / (midgap - thresh0); double b1 = Math.Sin(c1 * rad * 4 / 3); double g1 = Math.Sin(c1 * rad * 5 / 3); double r1 = Math.Sin(c1 * rad * 6 / 3); B = (int)((gB * c1) + (128 * b1)); G = (int)((gG * c1) + (128 * g1)); R = (int)((gR * c1) + (128 * r1)); A = gA;} if(tv > midgap) {c2 = (thresh1 - tv) / (thresh1 - midgap); double b2 = Math.Sin(c2 * rad * 4 / 3); double g2 = Math.Sin(c2 * rad * 5 / 3); double r2 = Math.Sin(c2 * rad * 6 / 3); B = (int)((gB * c2) + (128 * b2)); G = (int)((gG * c2) + (128 * g2)); R = (int)((gR * c2) + (128 * r2)); A = gA;} break; } } // Contour if (tv >= thresh1 && tv < thresh2) {switch(Amount5) {case 0: //rainbow if(tv <= midcont) {c1 = (tv - thresh1) / (midcont - thresh1); double b1 = Math.Sin(c1 * rad * 4 / 3); double g1 = Math.Sin(c1 * rad * 5 / 3); double r1 = Math.Sin(c1 * rad * 6 / 3); B = (int)((cB * c1) + (128 * b1)); G = (int)((cG * c1) + (128 * g1)); R = (int)((cR * c1) + (128 * r1)); A = cA;} if(tv > midcont) {c2 = (thresh2 - tv) / (thresh2 - midcont); double b2 = Math.Sin(c2 * rad * 4 / 3); double g2 = Math.Sin(c2 * rad * 5 / 3); double r2 = Math.Sin(c2 * rad * 6 / 3); B = (int)((cB * c2) + (128 * b2)); G = (int)((cG * c2) + (128 * g2)); R = (int)((cR * c2) + (128 * r2)); A = cA;} break; case 1: // background B = (int)src[x,y].B;G = (int)src[x,y].G;R = (int)src[x,y].R;A = (int)src[x,y].A; break; case 2: // transparent A = 0; break; case 3: // solid colour B = cB; G = cG; R = cR; A = cA; break; case 4: // shade across if(tv < midcont) {c1 = (tv - thresh1) / (midcont - thresh1); B = (int)(cB * c1); G = (int)(cG * c1); R = (int)(cR * c1); A = cA;} if(tv == midcont){B = cB; G = cG; R = cR; A = cA;} if(tv > midcont) {c2 = (thresh2 - tv) / (thresh2 - midcont); B = (int)(cB * c2); G = (int)(cG * c2); R = (int)(cR * c2); A = cA;} break; case 5: // shade along B = (int)(cB * rat); G = (int)(cG * rat); R = (int)(cR * rat); A = cA; break; case 6: // both ways f = factor to lighten if(tv < midcont) {c1 = (tv - thresh1) / (midcont - thresh1); B = (int)(cB * c1 * rat * f); G = (int)(cG * c1 * rat * f); R = (int)(cR * c1 * rat * f); A = cA;} if(tv == midcont){B = (int)(cB * rat * f); G = (int)(cG * rat * f); R = (int)(cR * rat * f); A = cA;} if(tv > midcont) {c2 = (thresh2 - tv) / (thresh2 - midcont); B = (int)(cB * c2 * rat * f); G = (int)(cG * c2 * rat * f); R = (int)(cR * c2 * rat * f); A = cA;} break; case 7: //both from source f = factor to lighten if(tc < midcont) {c1 = (tc - thresh1) / (midcont - thresh1); B = (int)(cB * c1 * rat * f); G = (int)(cG * c1 * rat * f); R = (int)(cR * c1 * rat * f); A = cA;} if(tc == midcont){B = (int)(cB * rat * f); G = (int)(cG * rat * f); R = (int)(cR * rat * f); A = cA;} if(tc > midcont) {c2 = (thresh2 - tc) / (thresh2 - midcont); B = (int)(cB * c2 * rat * f); G = (int)(cG * c2 * rat * f); R = (int)(cR * c2 * rat * f); A = cA;} break; } } // re assemble CurrentPixel = ColorBgra.FromBgra( Int32Util.ClampToByte(, Int32Util.ClampToByte(G), Int32Util.ClampToByte(R), Int32Util.ClampToByte(A)); dst[x,y] = CurrentPixel; } } } }
Now in my plugin pack Red ochre plugin pack
-
Hello again, I've reworked the effects formerly known as "Earths", which is now "Earths and greys", and "psychocolour"is also attached. Hopefully the code is a lot more readable now ?
I haven't started on "contour" yet - as I want to fully rewrite it.
Is this the best forum to 'publish' them, or should I have started a new thread?
Thanks for the help.
/* =================================================== */ /* */ /* Color EarthsnGreys.cs */ /* (c) 2011 Red Ochre */ /* */ /* Description: simplifies tones with choice of palettes */ /* */ /* ========================================== ======== */ // Name: EarthsnGreys // Author: Red Ochre // Submenu: Color // URL: http://www.getpaint.net/redirect/plugins.html // Title: Earths and Greys - 2011 Red Ochre #region UICode int Amount1 = 5; //[0,100]blur radius int Amount2 = 220; //[0,255]threshold 1 (whitest above) int Amount3 = 190; //[0,255]threshold 2 int Amount4 = 160; //[0,255]threshold 3 int Amount5 = 130; //[0,255]threshold 4 (midtone) int Amount6 = 100; //[0,255]threshold 5 int Amount7 = 70; //[0,255]threshold 6 int Amount8 = 40; //[0,255]threshold 7 (blackest below) byte Amount9 = 7; // colour palette|earth colours|close tone greys|full range greys|warm to cool neutrals|YORMBCG toned rainbow|YORMBCG straight rainbow|YORMBCG flat toned rainbow|reverse clashing rainbow #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Call the Gaussian Blur effect GaussianBlurEffect blurEffect = new GaussianBlurEffect(); PropertyCollection bProps = blurEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken bParameters = new PropertyBasedEffectConfigToken(bProps); bParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount1); blurEffect.SetRenderInfo(bParameters, new RenderArgs(dst), new RenderArgs(src)); blurEffect.Render(new Rectangle[1] {rect},0,1); ColorBgra CurrentPixel; int B, G, R, A; int B1,B2,B3,B4,B5,B6,B7,B8,G1,G2,G3,G4,G5,G6,G7,G8,R1,R2,R3,R4,R5,R6,R7,R8; B1 = 186;B2 = 130;B3 = 40; B4 = 30; B5 = 25; B6 = 10; B7 = 10;B8 = 10; // had to put some values here or unassigned variable problem G1 = 255;G2 = 220;G3 = 180;G4 = 125;G5 = 80; G6 = 40; G7 = 40;G8 = 20; R1 = 246;R2 = 240;R3 = 240;R4 = 190;R5 = 200;R6 = 130;R7 = 70;R8 = 20; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { switch (Amount9) { case 0: // earth colours B1 = 186;B2 = 130;B3 = 48; B4 = 30; B5 = 25; B6 = 10; B7 = 10;B8 = 10; G1 = 255;G2 = 220;G3 = 173;G4 = 125;G5 = 80; G6 = 40; G7 = 40;G8 = 20; R1 = 246;R2 = 240;R3 = 201;R4 = 190;R5 = 200;R6 = 130;R7 = 70;R8 = 20; break; case 1: // close tone greys B1 = 224;B2 = 196;B3 = 168;B4 = 140;B5 = 112;B6 = 84;B7 = 56;B8 = 28; G1 = 224;G2 = 196;G3 = 168;G4 = 140;G5 = 112;G6 = 84;G7 = 56;G8 = 28; R1 = 224;R2 = 196;R3 = 168;R4 = 140;R5 = 112;R6 = 84;R7 = 56;R8 = 28; break; case 2: // full range greys B1 = 255;B2 = 219;B3 = 182;B4 = 146;B5 = 109;B6 = 73;B7 = 37;B8 = 0; G1 = 255;G2 = 219;G3 = 182;G4 = 146;G5 = 109;G6 = 73;G7 = 37;G8 = 0; R1 = 255;R2 = 219;R3 = 182;R4 = 146;R5 = 109;R6 = 73;R7 = 37;R8 = 0; break; case 3: // warm to cool neutrals B1 = 193;B2 = 173;B3 = 154;B4 = 134;B5 = 115;B6 = 95;B7 = 75;B8 = 56; G1 = 224;G2 = 196;G3 = 168;G4 = 140;G5 = 112;G6 = 84;G7 = 56;G8 = 28; R1 = 255;R2 = 219;R3 = 182;R4 = 146;R5 = 109;R6 = 73;R7 = 37;R8 = 0; break; case 4: // toned rainbow // White Yellow Orange Red Magenta Blue Cyan Green B1 = 255;B2 = 146;B3 = 97;B4 = 91;B5 = 165;B6 = 220;B7 = 55;B8 = 0; G1 = 255;G2 = 255;G3 = 195;G4 = 92;G5 = 0;G6 = 0;G7 = 56;G8 = 16; R1 = 255;R2 = 255;R3 = 255;R4 = 255;R5 = 164;R6 = 0;R7 = 0;R8 = 0; //sum = 765, 656, 547, 438, 329, 220, 111, 16 break; case 5: // straight rainbow // White Yellow Orange Red Magenta Blue Cyan Green B1 = 255;B2 = 0;B3 = 0;B4 = 0;B5 = 255;B6 = 255;B7 = 255;B8 = 0; // note: orange is not G1 = 255;G2 = 255;G3 = 128;G4 = 0;G5 = 0;G6 = 0;G7 = 255;G8 = 255; // a perfect division of R1 = 255;R2 = 255;R3 = 255;R4 = 255;R5 = 255;R6 = 0;R7 = 0;R8 = 0; // the spectrum //sum = 765, 510, 383, 255, 510, 255, 510, 255 break; case 6: // flat toned rainbow // Grey Yellow Orange Red Magenta Blue Cyan Green B1 = 170;B2 = 0;B3 = 85;B4 = 128;B5 = 255;B6 = 255;B7 = 255;B8 = 128; G1 = 170;G2 = 255;G3 = 170;G4 = 127;G5 = 0; G6 = 128;G7 = 255;G8 = 255; R1 = 170;R2 = 255;R3 = 255;R4 = 255;R5 = 255;R6 = 127;R7 = 0;R8 = 127; //sum = 510, 510, 510, 510, 510, 510, 510, 510 break; case 7: // reverse clashing rainbow // White Magenta Blue Cyan Green Yellow Orange Red B1 = 255;B2 = 255;B3 = 255;B4 = 255;B5 = 182;B6 = 72;B7 = 100;B8 = 128; G1 = 255;G2 = 217;G3 = 218;G4 = 255;G5 = 255;G6 = 255;G7 = 191;G8 = 128; R1 = 255;R2 = 255;R3 = 218;R4 = 144;R5 = 181;R6 = 255;R7 = 255;R8 = 255; //sum = 765, 727, 691, 654, 618, 582, 546, 510 break; } CurrentPixel = dst[x,y]; B = (int)CurrentPixel.B; G = (int)CurrentPixel.G; R = (int)CurrentPixel.R; A = (int)CurrentPixel.A; int mylum = (R + G + / 3; // band 1 - white if (mylum >= Amount2) {B = B1; G = G1; R = R1;} // band 2 if (mylum >= Amount3 && mylum < Amount2){B = B2; G = G2; R = R2;} // band 3 if (mylum >= Amount4 && mylum < Amount3){B = B3; G = G3; R = R3;} // band 4 if (mylum >= Amount5 && mylum < Amount4){B = B4; G = G4; R = R4;} // band 5 if (mylum >= Amount6 && mylum < Amount5){B = B5; G = G5; R = R5;} // band 6 if (mylum >= Amount7 && mylum < Amount6){B = B6; G = G6; R = R6;} // band 7 if (mylum >= Amount8 && mylum < Amount7){B = B7; G = G7; R = R7;} // band 8 if (mylum < Amount8) {B = B8; G = G8; R = R8;} // re assemble CurrentPixel = ColorBgra.FromBgra( Int32Util.ClampToByte(, Int32Util.ClampToByte(G), Int32Util.ClampToByte(R), Int32Util.ClampToByte(A)); dst[x,y] = CurrentPixel; } } }
/* =================================================== */ /* */ /* Color Psycocolour.cs */ /* (c) 2011 Red Ochre */ /* */ /* Description: various psychedelic colour effects */ /* */ /* ========================================== ======== */ // Name: Psycocolour // Author: Red Ochre // Submenu: Color // URL: http://www.getpaint.net/redirect/plugins.html // Title: Psychocolour - 2011 Red Ochre #region UICode byte Amount1 = 5; // effect|colour phase shift|tone phase shift|alter by others|seperate colours by others|strange pointillism|out of phase shift double Amount2 = 0.5; // [0.0,1.0] phase shift #endregion void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CurrentPixel; int B,G,R,A; double f = Amount2; double rad = Math.PI*2; double phaseB,phaseG,phaseR; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; B = CurrentPixel.B; G = CurrentPixel.G; R = CurrentPixel.R; A = CurrentPixel.A; double lum = B + G + R; double rat = lum / 765.0; double b = B / 255.0; double bangle = b * rad; double g = G / 255.0; double gangle = g * rad; double r = R / 255.0; double rangle = r * rad; switch(Amount1) { case 0: // colour phase shift B = 128 + (int)(128 * Math.Sin((bangle + (rad * 1 * f)))); G = 128 + (int)(128 * Math.Sin((gangle + (rad * 2 * f)))); R = 128 + (int)(128 * Math.Sin((rangle + (rad * 3 * f)))); break; case 1: // tone phase shift phaseB = (1.0 / 3.0) * rad * f; phaseG = (2.0 / 3.0) * rad * f; phaseR = (3.0 / 3.0) * rad * f; B = 128 + (int)(128 * Math.Sin((rat + phaseB) * rad)); G = 128 + (int)(128 * Math.Sin((rat + phaseG) * rad)); R = 128 + (int)(128 * Math.Sin((rat + phaseR) * rad)); break; case 2: // alter each colour by the sum of the other 2 phaseB = ((B + (255 * f)) / (G + R + 1)) * rad; // add 1 to denominator incase G + R = 0 phaseG = ((G + (255 * f)) / (R + B + 1)) * rad; phaseR = ((R + (255 * f)) / (B + G + 1)) * rad; B = 128 - (int)(128 * Math.Sin(phaseB)); G = 128 - (int)(128 * Math.Sin(phaseG)); R = 128 - (int)(128 * Math.Sin(phaseR)); break; case 3: // seperate colours by others b = (G + R) / 510.0; bangle = b * rad; g = (R + / 510.0; gangle = g * rad; r = (B + G) / 510.0; rangle = r * rad; B = B + (int)(B * Math.Cos((bangle + (rad * 1 * f)))); G = G + (int)(G * Math.Cos((gangle + (rad * 1 * f)))); R = R + (int)(R * Math.Cos((rangle + (rad * 1 * f)))); break; case 4: // strange pointillism double ave = lum / 3; double Bdif = ave - B; bangle = f * Bdif; double Gdif = ave - G; gangle = f * Gdif; double Rdif = ave - R; rangle = f * Rdif; B = (int)(B + (ave * Math.Sin(bangle))); G = (int)(G + (ave * Math.Sin(gangle))); R = (int)(R + (ave * Math.Sin(rangle))); break; case 5: // out of phase shift phaseB = rad * b / (f + 0.01); // avoid divide by zero phaseG = rad * g / (f + 0.01); phaseR = rad * r / (f + 0.01); B = B + (int)(B * (Math.Cos(phaseB) - Math.Sin(phaseB))); G = G + (int)(G * (Math.Cos(phaseG) - Math.Sin(phaseG))); R = R + (int)(R * (Math.Cos(phaseR) - Math.Sin(phaseR))); break; } // re assemble CurrentPixel = ColorBgra.FromBgra( Int32Util.ClampToByte(, Int32Util.ClampToByte(G), Int32Util.ClampToByte(R), Int32Util.ClampToByte(A)); dst[x,y] = CurrentPixel; } } }
-
I'm working on the next version now, but probably won't post it tonight. Thanks for reviewing the last one - all useful points. The next one should be tidier.
Psychocolour (in Red ochre plugin pack)
in Plugins - Publishing ONLY!
Posted
Thanks for the feedback on the plugin and those are brilliant images you applied it to!
Particularly png4 (lower LHS) - an octopus leg vortex?