Jump to content

Reptillian

Members
  • Posts

    1,237
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Reptillian

  1. Unfortunately, it would not be easy to add it in. If it were possible to do post-processing Dents without resorting to gmic-pdn route or plain c# in visual studio (I only know how to do the former), then I could add it. This is why I release my source code other than belief in open-knowledge. Thank you anyways.
  2. Bifurcation diagram for two-parameters of torus-map or three-coupled oscillators. Preview: Download Plugin -> ThreeCoupledOscillators.zip After install, it's under Effect->Texture. ------------------------ License : CeCiLL v2.0 - https://cecill.info/licences/Licence_CeCILL_V2-en.html Codelab Source Code G'MIC Source Code
  3. I resorted to trying to find a color formula instead: Quite limited, but it's better than before. // Name: // Submenu: // Author: // Title: // Version: // Desc: // Keywords: // URL: // Help: #region UICode IntSliderControl max_iter = 50; // [1,200] Maximum Iteration DoubleSliderControl k_a_perc = 50; // [-100,100] K-A Tau (%) DoubleSliderControl k_b_perc = -50; // [-100,100] K-B Tau (%) AngleControl variable_angle = 45; // [-180,180] Angle DoubleSliderControl axis_scale = 2; // [1,15] Axis-Scale PanSliderControl point_xy = Pair.Create(0.000, 0.000); // Point CheckboxControl antialiased_mode = true; // Use Anti-aliasing? #endregion double tau = 2 * Math.PI; double tc = .7 / (2 * Math.PI); double rot_x(double a, double b, double sin_ang,double cos_ang){ return a*cos_ang-b*sin_ang; } double rot_y(double a, double b, double sin_ang,double cos_ang){ return a*sin_ang+b*cos_ang; } double oscil_a(double a,double b, double k_a){ return a+k_a-tc*Math.Sin(tau*b); } double oscil_b(double a,double b, double k_b){ return a+k_b-tc*Math.Sin(tau*b); } double norm2(double a,double b){ return Math.Sqrt(a*a+b*b); } void Render(Surface dst, Surface src, Rectangle rect) { int ww = src.Width-1; int hh = src.Height-1; double d_ww=(double)(ww); double d_hh=(double)(hh); double sd = Math.Max(d_ww,d_hh)/Math.Min(d_ww,d_hh); double sx = ww>hh?sd:1; double sy = ww>hh?1:sd; double cx = d_ww/2; double cy = d_hh/2; double cxsx=cx/sx/axis_scale; double cysy=cy/sy/axis_scale; double ang = variable_angle/180*Math.PI; double sin_ang=Math.Sin(ang); double cos_ang=Math.Cos(ang); double k_a=k_a_perc/100*tau; double k_b=k_b_perc/100*tau; double ix,iy,txp,xp,yp,ev,disp; int lim=antialiased_mode?2:1; byte r,g,b; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { ev=0; double[] col = new double[3] {0,0,0}; for (int m = 0 ; m < lim ; m++){ disp=m*.5; iy=(y+disp-cy)/cysy; ix=(x+disp-cx)/cxsx; ix-=point_xy.First; iy-=point_xy.Second; xp=rot_x(ix,iy,sin_ang,cos_ang); yp=rot_y(ix,iy,sin_ang,cos_ang); for (int n = 0 ; n < max_iter ; n ++){ txp=xp; xp=oscil_a(xp,yp,k_a); yp=oscil_b(yp,txp,k_b); } ev=norm2(xp,yp); col[0]+=(Math.Sin(ev)+1)/2; col[1]+=(Math.Cos(ev+ev/2)+1)/2; col[2]+=(Math.Sin(ev*2)+1)/2; } col[0]/=lim; col[1]/=lim; col[2]/=lim; r = (byte)((int)(Math.Round(col[0]*255))); g = (byte)((int)(Math.Round(col[1]*255))); b = (byte)((int)(Math.Round(col[2]*255))); dst[x,y]=ColorBgra.FromBgr(b,g,r); } } }
  4. This is yet another translation of my filter. I'm working exclusively with Render. Might be done, or not. Output: Here are the TODOs list: 1) Enable Anti-aliasing 2) Find ways to color the image // Name: // Submenu: // Author: // Title: // Version: // Desc: // Keywords: // URL: // Help: #region UICode IntSliderControl max_iter = 50; // [1,200] Maximum Iteration DoubleSliderControl k_a_perc = 50; // [-100,100] K-A Tau (%) DoubleSliderControl k_b_perc = -50; // [-100,100] K-B Tau (%) AngleControl variable_angle = 45; // [-180,180] Angle DoubleSliderControl axis_scale = 2; // [1,15] Axis-Scale PanSliderControl point_xy = Pair.Create(0.000, 0.000); // Point CheckboxControl antialiased_mode = true; // Use Anti-aliasing? #endregion double tau = 2 * Math.PI; double tc = .7 / (2 * Math.PI); double rot_x(double a, double b, double sin_ang,double cos_ang){ return a*cos_ang-b*sin_ang; } double rot_y(double a, double b, double sin_ang,double cos_ang){ return a*sin_ang+b*cos_ang; } double oscil_a(double a,double b, double k_a){ return a+k_a-tc*Math.Sin(tau*b); } double oscil_b(double a,double b, double k_b){ return a+k_b-tc*Math.Sin(tau*b); } double norm2(double a,double b){ return Math.Sqrt(a*a+b*b); } void Render(Surface dst, Surface src, Rectangle rect) { int ww = src.Width-1; int hh = src.Height-1; double d_ww=(double)(ww); double d_hh=(double)(hh); double sd = Math.Max(d_ww,d_hh)/Math.Min(d_ww,d_hh); double sx = ww>hh?sd:1; double sy = ww>hh?1:sd; double cx = d_ww/2; double cy = d_hh/2; double ox = (point_xy.First+1)*cx; double oy = (point_xy.Second+1)*cy; double cxsx=cx/sx/axis_scale; double cysy=cy/sy/axis_scale; double ang = variable_angle/180*Math.PI; double sin_ang=Math.Sin(ang); double cos_ang=Math.Cos(ang); double k_a=k_a_perc/100*tau; double k_b=k_b_perc/100*tau; double ix,iy,txp,xp,yp,ev; int i_ev; byte b_ev; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; iy=(y-oy)/cysy; for (int x = rect.Left; x < rect.Right; x++) { ix=(x-ox)/cxsx; xp=rot_x(ix,iy,sin_ang,cos_ang); yp=rot_y(ix,iy,sin_ang,cos_ang); for (int n = 0 ; n < max_iter ; n ++){ txp=xp; xp=oscil_a(xp,yp,k_a); yp=oscil_b(yp,txp,k_b); } ev = norm2(xp,yp); i_ev=(int)(Math.Round(ev*200)); b_ev=(byte)(i_ev); dst[x,y] = ColorBgra.FromBgr(b_ev,b_ev,b_ev); } } }
  5. @AndrewDavid That's pretty weird since TiledForm.dll is located inside GmicPDN folder in my computer and it works on mine. But, I'm glad you got it resolved. I will add a note to the first page. It's possible you have a duplicate somewhere though I can't say that for you.
  6. @AndrewDavid All I could do is rebuild, and then reupload the TiledFormGmicPdn.zip. That is what I did, and this is the last time I'll do this. Download once more. The code doesn't show a problem, and @lynxster4 and I can confirm that they work without problem. If it doesn't work on your side, there's not much I can do about it other than resorting to C#, and going with very difficult to maintain code. There is a possibility of a image being a problem, do PM me the offending image of the problem layer to see if I can replicate the problem. This is the metadata information of the .zip file I uploaded and recently built from Visual Studio + send to .zip - ‎Modified: Thursday, ‎December ‎2, ‎2021, ‏‎3:22:15 P
  7. Yes, good catch. I also moved Axis Streak to Object for usage clarification. There also might be dll files name changes (I wasn't really paying attention to the original name or forgotten about that.)
  8. Thanks, now I am able to update those two threads. -------- For those who arrived, there's a new update to this plugin. Made to be compatible with latest PDN as it's now .NET 6. In addition, it is moved to Object menu. In addition, there been a slight change into installation of g'mic-pdn plugins. Reason being is due to meeting the rule requirement. Please read before download.
  9. Thanks, now I am able to update those two threads. -------- For those who arrived, there's a new update to this plugin. Faster algorithm (The fastest case is close to PDN), and it is compatible with .NET 6 now. In addition, there been a slight change into installation of g'mic-pdn plugins. Reason being is due to meeting the rule requirement. Please read before download.
  10. @toe_head2001 Thanks toe_head. Now, gonna need a post in Fragment Blur+ thread, and Axis Streak for me to be able to edit them or even post in them. ----- That being said, I updated the Tiled Form plugin into .NET 6 and made a bug fix within g'mic code. It received a new icon as well. Added multiple instruction on the GmicPDN/GmicSharpNative download link, and .deps.json file to be in accordance with @Rick Brewster rules. There's actually two different ways to install the gmic-pdn plugins since they always will be made to be compatible with latest GmicSharpNative.
  11. Thanks. @toe_head2001 Could you make a post in my Tiled Form thread? I don't think I can edit it. Last time, someone else had to post for me to be able to edit that thread.
  12. I tested it, and I think I got it: I think what you did was a black anti-aliased outline of 3 px, low hypo (%), and high duplicates (This is on a transparent layer). Then you duplicated the image again. This gives me almost 1:1 look. The picture use aliased mode. Thanks for testing these plugin. I will be releasing Tiled Form and Axis Streak. If you need the old gmicsharpnative to test the old version of Fragment Blur+, I will be pming you that once you're here. Just don't be distracted at work. Axis Streak wasn't released here as a test because there isn't going to be g'mic code change, and the base test of .NET 6 transition has passed. -------- I'll make a separate post from here to describe the new instructions. It should be set up exactly how lynxster4 did it.
  13. @lynxster4 I have managed to build the optimized Fragment Blur+ plugin to be released this month. There will be a slight instruction change, but installing them with current instruction will work. In addition, there is a bug fix release for Tiled Form. They both updated for .NET 6 in mind. You may want to delete the files with similar names to those I made first. Here's the two files. You can ignore deps.json if you want. Fragment Blur+ (Optimized)-> Deleted Tiled Form (Bug Fix)-> Deleted Let me know if they work.
  14. @null54I changed the number from 5 to 6 in g'mic-pdn dependencies, and it works. I think that's all that needed to be done. I did had to delete built file to make it actually build though.

  15. This is a question that I have. Right now, it seems that .NET 5.0 is supported, but for plugin development, should the transition be now? Is there a set end-date for .NET 5 support? Looks like this error answers my question: Going with yes. Time to install VS2022 then. EDIT: Do I uninstall 2019 first, and then install 2022, or should I install 2022 straight away?
  16. Ok, optimization from the g'mic side of thing has been pushed: https://github.com/dtschump/gmic-community/commit/68cc4d4b65aba12c33523d5e4de775477d6cf174 It is 120%-715% faster than the previous version of g'mic fragment blur. The fastest cases is almost as fast as the PDN version. The more precise case is still 6-11 times slower than in PDN. Since it works, it can be adapted for the g'mic-pdn.
  17. The only one that needs fixing is the Fragment Blur. The Axis Streak one is already optimized though in theory, it can be optimized further with the usage of information already generated, but that's not needed and it's more work than I want to do anyway.
  18. For anyone that's still waiting on my filters. I do have a estimate on when G'MIC 3.0 will arrive according to @G'MIC. It will be at near end of the year. He's looking at things to improve on right now before the release. Right now, I'm working on optimizing Fragment Blur. The nearest neighbor algorithm will be as fast as PDN version (1.8 s on a ~5300x3700 image with both using 50x duplication) even with boundary condition, and the bilinear approach is now going to be 160% faster than current version. It's slower than the nearest neighborhood algorithm because it uses more data, duh. The optimization will come to the plugin version as well.
  19. Cancel out the changes to incompatible. I worked out a optimization to G'MIC Fragment Blur (Not ideal, but 160% faster) thanks to garagecoder over another forum I go to. That means they certainly will be updated by next month.
  20. In my opinion, it can be rewritten entirely from scratch without even needing to use @loupasc code at all. I don't know if a simplified or easier to read solution would be slower.
  21. On CLI or on G'MIC-QT->Various->Code. If using the latter, then type 'colormap 0'., then click ok. You should save the palette elsewhere.
  22. I believe color curve would be the answer here. Not sure if this matches. IIRC, C++ and C# are almost as fast each other. So, if euclidean distance is too slow on the C#, it's a safe bet that gmic version use binary search. Let me call @G'MIC. From a online document: -index Given a palette or look-up table of reference colors and a source image, the command determines for each source image pixel, the most closely matching reference color in the palette.
×
×
  • Create New...