Jump to content

Reptorian's G'MIC Code Workshop


Recommended Posts

15 minutes ago, BoltBait said:

More like my brain after looking at G'MIC scripts... they literally make NO sense to me at all.

That how it was for me when I started out on G'MIC. There's actually a lot of different ways to do different things, and I had to learn basic things like f block (for x,y,z loop block), eval block, shared channels, etc and that with a vast command within gmic stdlib like index, sort, resize. It gets easier like with other programming language, and reading up on references makes it easier to understand over time. Fill block code is the easiest to understand because it's basically for x, for y, for z where begin can contain variable before for x,y,z and end can contain variable after the first part of for x,y,z loop. I know you don't plan to do gmic coding, but I'd just like to share details on how it was for me, and I'm also available if you'd like to convert a g'mic script into a pdn plugin.

Edited by Reptillian
Link to post
Share on other sites
11 hours ago, LionsDragon said:

Frost on the windows!

 

I second that! 

  • Like 1
Link to post
Share on other sites

Now, I am working on adding masking features to DLA filter.

 

72805d0f5c80e5a512c547d4ab334e7c422f8ffb

 

You see that it is growing around the test? The test letter is the image. And yes, I will add a option to erase the image mask though I have to figure out how to display only the "sprouts" or something.

 

EDIT: Solved it.

 

5ac0a9e22e1c88e85e8faf73fe3361ad8317c13d

Edited by Reptillian
Link to post
Share on other sites

New Filter! - Pseudorandom Noise

 

The advantage of this version over the Regular Noise Texture plugin is that it's far easier to use, and some bugs are addressed. There's also way more variety that is possible. I will say that the colors are not the same because of the underlying mathematical difference within c++,c# in context of float to int.

 

Note: There is a bug on the filter with double pixel axis mode, but single pixel axis looks better anyway, so I wouldn’t be so pressed about it. I will fix that bug when the time comes. It probably shows up with a specific dimension, so if you do come with the 3 pixel axis bug, let me know the dimension and which axis.

Edited by Reptillian
  • Like 1
Link to post
Share on other sites

I had created another new filter. @MJW did a existing filter called Posterize in HSV space. So, I coded it my own version that allows for indexing in HSX color space or posterize using mathematical operation. It'll come tomorrow. I can't really say it's interesting, but it's a good exercise to work with 3 dimensional cube with 3 color channel per pixels.

 

To clarify:

 

$hb,$scb,$lub,3,[floor(360/($hb-1))*x,y/($scb-1),z/($lub-1)]

 

$hb = Hue Band

$scb = Saturation Band

$lub = Luminosity Band

3 is the number of channel on that argument

[] defines the colors that exists within the band. x is of course x-coordinate of pixel, y is y-coordinate of pixel, and z is z-coordinate of pixel.

 

This is used for indexing colors based on the above box. Indexing can be pretty slow as you can do this with 50x50x50 which means indexing using 125000 colors.

 

Posterize doesn't really use 3-dimensional box.

Edited by Reptillian
  • Like 1
Link to post
Share on other sites

New Filter! - Tiled Zoom

 

It's pretty much only a slight upgrade to @Ed Harvey Multiview plugin. You can change the width and height independently. It doesn't have boundary option of original, etc because you can already do that with none and the existing layer, so it's pointless IMHO. I figured out how it works when I thought of the theory to have repeating row and column gradient that goes from -v,+v, and to use j which means offset away from current x,y within for x,y loop.

 

To expand:

 

Snippet of rep_tiled_zoom:

 ix=(x+iox)%"$sqr_w"-cx;
 iy=(y+ioy)%"$sqr_h"-cy;
 nx=ix*sd;
 ny=iy*sd;
 fx=nx-ix;
 fy=ny-iy;
 j(fx,fy,0,0,2,boundary);

 

iox,ioy means offset required for the window to be the same on edge.

cx,cy is half window size.

ix,iy creates the gradient.

nx,ny are scaled gradient.

fx is the difference.

j means away from pixel. so -1 means the color will be based on image pixel 1 pixel to the left.

Edited by Reptillian
  • Like 1
Link to post
Share on other sites

If you updated the filter now and see nothing, check by a day. Otherwise:

 

I added Fill Tool to Non-Isometric Tiler filter. Please read instruction to see how to use it. I have not enabled the fill for symmetry mode just yet and probably won't do so for some time. In most cases, you don't need to fill with symmetry conditions, and the current painting with symmetry mode does that job anyway if careful.

Edited by Reptillian
  • Like 1
Link to post
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...