Reptillian

Reptorian's G'MIC Code Workshop

Recommended Posts

Now working on only adding a filter based off fragment blur since I already made the code for use in the PS Emboss inspired filter. Here's the options I'll put in.

  • Color Space
  • Duplicate Count - int (2-100) At 100, it'll be barely noticeable that there's obvious fragment.
  • Distance - float (0 - 200)
  • Angle - float (0-360)
  • Boundary Condition - choice(None, Neumann, Periodic, Mirror)
  • Superimpose w/ Original? bool(0 = Remove original image and do not super impose with original | 1 = Superimpose with Original )
  • Blending Mode

*Note: Blending mode option will be hidden or disabled with superimpose at 0. Color Space would barely change much on normal mode at 50%, but I'd be curious to see how much subtle difference there would be.

Edited by Reptillian
  • Like 2
  • Upvote 1

Share this post


Link to post
Share on other sites

I have just made the fragment blur. Here's the output example.

 

image.png.075a1da08504cb2f03495b901cb3ae0a.png

 

- Inputs -

Color Space - LCH

Superimpose w/ Original - Checkmark Yes

Duplicates Count = 6

Distance (%) = 73.5%

Angle = 151.2

Boundary Condition - Mirror

Interpolation - Checkmark Yes

Share this post


Link to post
Share on other sites

Now, my version of fragment blur is coming to G'MIC soon.

 

My next project is this -

 

rv to_rgb[^0] f[0] "i(i#2/255*w#1,i#1/255*h#1)"

 

This basically treats the bottom layer as a blending mode. The value gives the coordinate. You do need 3 images for this to work though a workaround is to import file(s).

 

-----

 

image.png.9c00e30c310fc5c54ea8b838f1df9406.png

 

The result of the code. The Left determines the Y, and the Middle determines the X, and the result treating image as a blending mode is on the right.

Edited by Reptillian

Share this post


Link to post
Share on other sites

Another update - I may be able to complete the pdn glitch art serie transfer to G'MIC. The missing one is spiral transform. I discovered @G'MIC made spiralbw (I think he did).

 

to_a +spiralbw l. +to_rgb a c endl f[0] "i(i#1%w,floor(i#1/w))" k..

 

The above gives spiral transform,that means I am able to do what the original pdn glitch author wanted to do, but can't.

 

Edited by Reptillian

Share this post


Link to post
Share on other sites

New Filter is coming soon!

The new filter is named 'Spiral Matrix Transform'. Inspired by the pdn glitch plugin which utilize ulam spiral transform. It's not the same thing, but it's actually reversible. Also, you can destroy images in a glitch-art manner by applying a blur filter or smoothing filter after you applied spiral transform, and then reverse it.

Edited by Reptillian

Share this post


Link to post
Share on other sites

Actually, I got bad news for the Spiral Matrix Transform filter. G'MIC dynamic array doesn't support anything bigger than 4096x4096.

 

G'MIC Community Issue #174 - Very strange bug when it comes to vector or spiralbw - Reptorian

 

So, that filter will have to wait for a while. I decided to put in a wait time list before coding in a filter restriction. I'll give it a month. Meanwhile, if you would like to use it, you'd have to copy and paste code into update.gmic if you would like to use it. It's useful for creating interesting looking borders or has application for glitch art.

Edited by Reptillian

Share this post


Link to post
Share on other sites

Meanwhile the spiral matrix transformation is on hold because of the dynamic array limitation of G'MIC (limit is 4096*4096), and I don't know how to convert it into a 1D formula to avoid that issue, I decided to take my time to solve the PDN Nebulous plugin and convert it into G"MIC format. Now, it becomes easier to maintain, and I am able to expand it since it is easier to make more complicated version of PDN plugin in G"MIC. Here's the result of my work so far.

 

image.png.18000c5930b2255e103e29f25ea95683.png

 

As you can see, this is a nebulous texture. Only 1 Channel, and this is the output. I could get the color by using nebulous effect on one g'mic layer, and then normalize it to 0-360 range and have 100 for second g'mic layer, and have 100 for third g'mic layer. Then append_channel, and then I type in hsv2rgb to get the rainbow version.

  • Like 1

Share this post


Link to post
Share on other sites

Okay, I think I got it now. It behaves a little differently than its PDN equilavent, but that's ok. I added new features regardless. It's on testing phase as I haven't made the GUI yet, but can be tested via code[local] once it arrives. I may add angle for distortion as well though I believe that would be difficult.

 

Here's the options

 

#@cli rep_nebulous: _color={ 0=gray | 1=color },_rings>0,zoom_scale_x>0,zoom_scale_y>0,-100<=x_center[%]<=100,-100<=y_center[%]<=100,0<=_fxyangle<=360,_wave,0<=_lighting_angle<=360,_disturbance>=0,_distx,_disty,_subpixelevel,0<=_subpixelprocessingmethod<=4

 

The new feature as you can see are shifting, and angle. Also, wave has been adjusted to make it more intuitive. Like 0 wave makes rings instead of waves.

 

Nebulous may come soon to G'MIC though that depends on whether the CLI order is fine. If not, I'll have to change the order for G'MIC CLI users.

 

image.png.b37ea58df252ecbe18f101f990d5818e.png

 

@MadJik : Thank you for making this possible!

 

-----

EDIT: Figured out how to apply angle distortion. At this point, it's the best Nebulous filter could get. GUI version will have alpha option.

Edited by Reptillian
  • Like 1

Share this post


Link to post
Share on other sites

Spiral Matrix Filter is here. By the way, if you are going to reverse the transformation, there's a limitation of 4096^2. Anything beyond that will have a error. That is IEEE Float restriction. I will someday get around that limitation, but for now, I have no interest into bothering to try. Reverse-Forward will work as well as Forward-Reverse.

 

EDIT - G'MIC Nebulous has been pushed, and it's here.

 

Look like I'll have to fix NCEE filter, well ok.

Edited by Reptillian

Share this post


Link to post
Share on other sites

I checked the update via pdn gmic, looks like y'all going to have to wait for new version to retrieve spiral matrix filter, and g'mic nebulous.

 

Another filter is coming again. I just replicated @MadJik Gravity filter for G'MIC.

 

For now, I have this.

 

#@cli rep_sptbwgp: (eq. to rep_shift_pixel_to_boundary_with_group_pixels)
rep_sptbwgp: rep_shift_pixel_to_boundary_with_group_pixels $*
#@cli rep_shift_pixel_to_boundary_with_group_pixels: _axis={ 0=Horizontal | 1=Vertical }, 0<=_position<=1, _threshold
#@cli : Shifts pixels to boundary by percentage using grouped pixels. position less than .5 means shift will be negative, and position greater than .5 means shift will be positive.
rep_shift_pixel_to_boundary_with_group_pixels:
repeat $! l[$>]
skip ${3=0}
iw={w}
ih={h}
dir=$2

if s==1||s>5 v + error "Spectrum depth cannot be less than 2 or greater than 5!" fi
f "s==2?(i1<$3?0:i):(s==3?(i2<$3?0:i):s==4?(i3<$3?0:i):s==5?(i4<$3?0:i))"

if $dir<0||$dir>1 v + error "Exceed the boundaries!" fi

if $1
s x
repeat $! l[$>] r 1,{h+1},100%,100%,0,0,.5,1 autocrop_components ,,,, a y r 1,$ih,100%,100%,0,0,.5,$dir endl done
a x
else
s y
repeat $! l[$>] r {w+1},1,100%,100%,0,0,1,.5 autocrop_components ,,,, a x r $iw,1,100%,100%,0,0,$dir,.5 endl done
a y
fi
endl done

 

A new feature is planned though. I will be adding influence factor. Also, unlike the pdn gravity, you can put it to the center than into the boundary by setting position to .5.

 

---

 

While making a command to make the map to be used as a base, I have to wonder, does this need to be it own filter?

 

image.png.27c990caef15f0ede6ed5bea093fff57.png

 

Result of the command I made

 

 

Edited by Reptillian

Share this post


Link to post
Share on other sites

Now, you can test my filters as G'MIC 2.6.2 has been released for Paint.NET.

 

Image #1

 

temp.png.f02aaf4dfc877e39e91bb9a9d301dc04.png

 

Shift Position = -1, Axis=Vertical, Influence Factor=.5

 

 

temp.png.ec0f674e14b41089afdb17859c2ba11b.png

 

Shift Position = 0, Axis=Vertical, Influence Factor=1

 

Influence Effect isn't perfect though as in some cases there will be pixels that are detached. Don't know what to do about that, but this is my best attempt for the scope of this filter.

Edited by Reptillian

Share this post


Link to post
Share on other sites

Initially I totally misread those images! I figured the rainbow was dropping onto the hillside & couldn't figure out why the profile of the skyline was being altered. Doh!

Share this post


Link to post
Share on other sites

Ok, just uploaded the change of one sided backdrop instead of two to reduce distortion when using influence factor. Not perfect, but it works better than two sided backdrop. Now to wait since I don't have access to merge request. It will be for G'MIC 2.6.2. Also, did fixed a nebulous bug.

Edited by Reptillian

Share this post


Link to post
Share on other sites

Now, I have successfully fixed all issues with my Grouped Pixel Axis-Based Shift which is extended version of @MadJik Gravity filter. Should here shortly. By the time you read this post, it's probably here.

 

If it say  2019/5/14 , then it means it arrived.

 

For proof!

Original

 

gravity3.png

 

No change to above image.

 

temp.png.372fb0be9c6b5e332e1e68c4134003a7.png

 

Axis=Horizontal, Influence is between 0-1, position is between 0-1

 

With the new changes I commited to g'mic-community, lines don't break anymore.

 

-------

Filter update has arrived.

 

Also, I made scintilate as well. This one works on YUV color space.

 

iw={w}
ih={h}
is={s}
mini_square=20
large_square={ceil((sqrt(w^2+h^2))/$mini_square)*$mini_square}

2,2,1,1,(x+y)%2
r. {$mini_square*100}%,{$mini_square*100}%,100%,100%,1
r. $large_square,$large_square,100%,100%,0,3
rotate. 62.5,1
r. $iw,$ih,100%,100%,0,0,.5,.5
r. 100%,100%,1,$is,0
*. 255
split_opacity..
rgb2yuv8...
f... "abs(i#0-i#2)"
yuv82rgb...
a[^-1] c k..

Paste that into code[global] or code[local] and see what you get.

 

You can also change color space, but use 8-bit color space. See G'MIC reference.

 

You can edit mini_square and numbers next to rotate. On second part of rotate, 0 = nearest, 1 = linear, 2 = bicubic

Edited by Reptillian
  • Like 1

Share this post


Link to post
Share on other sites

6 new palettes has been added. It was pushed by gmic maintainer 6 hrs ago

 

Name ; ID

- Amiga 7800 M.E.S.S palette ; amiga7800mess
- Amiga 7800 NTSC ; amiga7800ntsc

- Amiga 7800 PAL; amiga7800pal

- Sam Coupe ; samcoupe

- VGA; vga

- Deluxe Paint; deluxepaint

 

Their number id details here - https://github.com/dtschump/gmic-community/pull/182/files

 

Type in "pal {palette id} k." in code global/local to verify

 

There are now 143 palettes for G'MIC

 

-------

 

I am near at a point where I’ll be rewriting the Concrete Material Texture for new features altogether, besides the seamless issue, I believe I could use several different ideas. As many as possible. But then again, I might work on true autochrome stimulation, though it’s one or the other at this point.

Here’s on my backnotes -

  • Color Blending Factor - Forces the result to stay within a certain colors
  • A-B Contrast - Lower Contrast means less blue and/or yellow and/or less red and/or green. And higher contrast means more saturation on blue, yellow, green, red.
  • Fix seamless-ness
  • Local Contrast

Some ideas I just thought off

  • Minibumps- This just add a mini bumps surface over the concrete material.
Edited by Reptillian

Share this post


Link to post
Share on other sites

18 new palettes and more Nebulous fixes have arrived. A double multipler for disturbance level is needed for precision purpose. Also, I created a option to link x and y factor with disth and disty for flexibility purpose.

 

- Palettes changes -

amiga7800 ntsc/pal series is now just amiga7800.

 

C64 palettes now has two interpretations - Colodore and Pepto.

So, their cli code is pal c64_colodore and pal c64_pepto

 

Fornax Void palettes, 2 autochrome palettes, and popular user palettes like nature embrace 55 been added.

 

---

 

What's coming? Rewrite of construction texture, asmageddon tools with 3 boundary condition and interpolation. I already recreated strange bulger a and b(Merged), and sinusoidal shaking.

Edited by Reptillian
  • Like 1

Share this post


Link to post
Share on other sites

I'm just gonna show off what I have here. I converted the quaddro bumperoo/inverto into g'mic code, and mixed them, and extended them with the option to use and,or operation instead of xor.

 

Sample Image

 

da9a461d343ca17448fa9e1f6a566da22da65a9c

 

Generated from this code -

rep_binaltquadtex 10,6,99,2,0 % 361
{w},{h},1,1,1 {w},{h},1,1,1
a c
hsv2rgb

Note: rep_binaltquadtex is not available yet. rep_binaltquadtex is separated from the % 361 as I want the option to use it as a coordinate map like I did with spiral matrix. As you note, rep_binaltquadtex is one channel only.

Edited by Reptillian

Share this post


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.