Jump to content

Reptorian's G'MIC Code Workshop


Reptillian

Recommended Posts

I had changed Reverse Engineer Gradient Map. Thanks to garagecoder at discuss.pixls.us, he was able to optimize the part of reverse engineering gradient map. Now, you can use large image, and you get result quickly. No need to wait 3 s or more.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

Roadmap for 2021:

  1. Refactor Naeddyar mapmaking script to more suitable version. He wrote scripts with little knowledge of gmic scripting. So, hence the need of refactoring. <- I’m here now.

  2. Refactor few of my script and adding new feature.

  3. New filters only after the refactor. I won’t be refactoring my script for optimization, etc. I'll be making filters that are so much harder to create.

Edited by Reptillian
  • Like 1

G'MIC Filter Developer

Link to comment
Share on other sites

New filter Color Curve Reverse Engineering. This can be used to create a gradient map using essentially what the calculated color curve on a black and white gradient. So, you can find approximate Instagram filters color curves, etc.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

On 1/2/2021 at 2:12 AM, Reptillian said:

Roadmap for 2021

 

On 1/2/2021 at 2:12 AM, Reptillian said:

I'll be making filters that are so much harder to create

 

Good luck on the road!

 

Speaking of the filters that already exist: I discovered your Non-Convolution Edge Extraction the other day and was really impressed by its accuracy and settings (Blending Opacity is the best). :star: Added to Faves; how come its status is still "testing"?

 

edgy-bird.png

And playing with Offset / Angle can make surprising things...

 

shady-pairing.png

  • Like 1

signature.png.ebe2dec8b8faab2aa57630b352

my gallery is  here

 

Link to comment
Share on other sites

On 1/6/2021 at 1:22 PM, Reptillian said:

That being said, I added 3 new formulas to Thorn Fractal:

 

Have you had a chance to make this upgrade?  🙂  Thanks!

Link to comment
Share on other sites

18 minutes ago, lynxster4 said:

 

Have you had a chance to make this upgrade?  🙂  Thanks!

 

Yes. If it haven't arrived, then that means that gmic version is no longer supported and a new version should arrive at some point later which would have this update after refresh.

  • Like 1

G'MIC Filter Developer

Link to comment
Share on other sites

Note: The new rep_recpoltrans has not been implemented yet. I still have to edit rep_axis_streak_color to finally fix a bug before release.

 

Wow! Now I think I solved recpoltrans! The new changes is by far more faster. From 1.5 s to .194 s. It is also more accurate. I only worked on if -3, and 2 part of rep_recpoltrans since they matter a lot more than the others as they’re both designed for precision. The others if in rep_recpoltrans don’t really matter too much for me to fix them. In addition to these changes, I’m closer to fixing a bug in perspective streak!

 

See here.

 

U5gOuOc.png

 

Left: Original Middle: recpoltrans -3 to recpoltrans 2 Right: Xor Analysis

 

[gmic]-2./ Elapsed time: 0.19 s.

 

Also, saving code here:

G'MIC Filter Developer

Link to comment
Share on other sites

  • 4 weeks later...

I'm gonna put the rep_recpoltrans on hold for now.

 

I'm working on mode-related image processing. Speaking of which, does anyone know that thread where a person asked to fill image based on mode of colors? I really would like to mention that person even if it fruitless now.

 

In the spoiler, there are 3 cases, and how the mode are calculated are different.

 

Case IMGS>2 : Find the mode of all images within the same pixel coordinates. Outputs nan if multiple modes are found or no modes are found.

Case IMGS==2: Checks if pixels are the same. If they are, output the current pixel, otherwise nan.

Case IMGS==1: Find all the mode within a image. If there are no mode, do nothing. If there are multiple modes, then you can choose which modes to choose or output a nan if no input is detected.

 

Spoiler


rep_mode_color:
if $!>2
 +a z colormap. 0
 a[^-1] c
 {w#0},{h#0},{d#0},{s#1},"begin(
  const vs=w#1;
  const ss=s#1;
  const css=s#0/ss;
  endnan=vectors(nan);
 );
 nmaxfreq=0;
 vfreq=vectorvs(-1);
 vp=I#0;
 for(pos=0,pos<css,pos++,
  curcol=vp[pos*ss,ss];
  for(posfreq=0,posfreq<vs,posfreq++,
   coltestpos=I(#1,posfreq,0,0);
   if(curcol==coltestpos,vfreq[posfreq]++;);
  );
 );
 maxfreqcount=max(vfreq);
 if(maxfreqcount+1,
  posmaxfreqcol=find(vfreq,maxfreqcount,0,1);
  for(fs=0,fs<vs,fs++,if(vfreq[fs]==maxfreqcount,nmaxfreq++;););
  if(nmaxfreq==1,I(#1,posmaxfreqcol,0,0);,endnan);
 ,endnan;
 );"
 k.
elif $!==2
 f. "begin(endnan=vectors(nan););I==I#0?I:endnan;" rm..
else
 minv={im}
 - $minv
 
 repeat s
  sh. $>
  bsize$>={iM#-1}
  rm.
 done 
 
 if s==1
  $bsize0,1,1,1 eval.. ++i(#-1,i,0,0,0)
 elif s==2
  $bsize0,$bsize1,1,1 eval.. ++i(#-1,I,0)
 elif s==3
  $bsize0,$bsize1,$bsize2,1 eval.. ++i(#-1,I)
 else
  $bsize0,$bsize1,$bsize2,$bsize3 eval.. ++i(#-1,I)
 fi
fi

 

 

EDIT: Found the thread -

That was the thread that inspired me to do this.

 

Also, tagging @FanofSMBX
even if pointless.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

I finished with the mode filter. I tested this code

 

$ sp cat rep_dupsdaxy 12,50,20,1,1,0 rep_mode_color ,, {w},{h},{d},1,!isnan(i#0)?255 replace_nan.. 0 a c drgba

 

3676b093ad257a6e079fb74eceedff78407f3dd3

Potential for a new artistic filter. It's pretty slow though because you are calculating the mode as a blending mode.

  • Like 1

G'MIC Filter Developer

Link to comment
Share on other sites

  • 3 weeks later...

I restored it with a measure to hopefully prevent BSOD crash.

 

If it happens to you with Henon Phase Diagram, don't hesitate to report it as it's going to need to be blocked again.

 

Details from github:

 

I'm going with these measures to avoid BSOD crash:
1. Added if inf,-inf break line. I theoretize that this is the main reason for the crashes.
2. Limited X0 Increments.
3. And test some more to see if it needs to be blocked again.

 

Clarification on 1: I believe that it was using inf, and -inf, nan, -nan weirdly on multiple threads at once running as fast as possible, and that's why I get BSOD error, so I added the break line in hope to resolve that.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

  • 2 weeks later...

It seems that Henon Phase Diagram has been working. Had not caught a BSOD problem.

 

That being said, not much update for now. I will point out that I had split Overload Count in Thorn Fractal into 2 different variables. So, you only have positive number on overload count, and a checkmark option to switch to negative overload mode. This makes it easier to switch from positive to negative, and vice versa.

  • Like 1

G'MIC Filter Developer

Link to comment
Share on other sites

  • 3 weeks later...

Added new filter! Skew!

 

bFk62e6.png

 

Thanks to @BoltBait for inspiration, and @mszlazak for the idea of using angle.

 

It should be here in a hour or two. Probably here by the time you're reading this comment. So check by.

 

Commit: https://github.com/dtschump/gmic-community/commit/9ae1f91f611840cafc893b8c85e08aada62d39b5

Edited by Reptillian
  • Like 1

G'MIC Filter Developer

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...