Jump to content

Reptillian

Members
  • Posts

    1,239
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Reptillian

  1. Hmm, it's something I can do. I made the brick version of those.
  2. Fragment Blur has been moved from Testing to Degradation. Furthermore, I changed it so that half-hypotenuse is used instead because result don't change all that much, and you have higher degree of precision.
  3. Problem been solved as I wasn't able to delete them, now I can attach files. Close this. Thank you so much.
  4. That is what I did, but I do not see the trash can. The message remains there.
  5. I can't delete attachments here. There is no x cross and there is this meseage that says "You have used...".
  6. I learned this the hard way. I could upload .dll in case I decide to convert my filter if I could delete files.
  7. I had to use G'MIC internal codes, hence 4 surface. That being said... In context of C# and PDN: I think you only need two surfaces. The N value can be found by looping through current row/column and checking if alpha value is greater than 0, and if it is, N++. Then perform the shift found in codes deeper than N value code. Perhaps, it wasn't as straight forward even if it use the general for x,y codes. I may attempt to convert this as an alternative plugin to MadJik Gravity as this version has float-based influence and float-based position factors.
  8. Now that Grouped Pixels Axis-Based Shift G'MIC filter has been updated, and with no bugs or negligible bugs count, you can use this filter to place pixels right in the center. The speed of that filter has improved so much to usability in context of this tutorial. This note has been added.
  9. Taken a break from that for a while. So, here's what I did: I have pushed rep_primelist cli and rep_prime_surface (The algorithm is slow, but miles faster than the earlier one), better version of Grouped Pixels Shift filter, some undeveloped cli only pushed there for development purpose and backup. The rectangular fill surface isn't really finished yet, but there is some new clis related to it, so that I can get to working when I'm really back with g'mic development. Also, the algorithm for the Grouped Pixels Shift filter is literally fast, and I believe it can be introduced very easily in context of PDN and C#. So, I will share the code here with a explanation. Is multiple surfaces possible in Paint.NET plugin? @Ego Eram Reputo This code uses 4 different surfaces. If not, I'll delete this since it can't be translated. #@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: -1<=_position<=1, _axis={ 0=Horizontal | 1=Vertical }, 0<=_influence_factor<=1, _threshold>=0,_channel_mode #@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. #@cli : Assign an argument to _channel_mode if you want to disable restricting effect on alpha channel or avoid manipulating 4 channels image in case of CMYKA image. Only use in rare cases! #@cli : Default values: '_position=-1','_axis=1','_influence_factor=1','_threshold=0','_channel_mode=' rep_shift_pixel_to_boundary_with_group_pixels: skip ${1=-1},${2=1},${3=.5},${4=0},${5=} any_channels=0 #In context of PDN, you can ignore this# tcr=3 #In context of PDN, you can ignore this# influence_factor={min(abs($3),1)} #Determines the amount of effect to be applied# position={(($1+1)/2)} #Position shift of rows/column# if $position<0 position=0 #In context of PDN, you can ignore this# elif $position>1 position=1 #In context of PDN, you can ignore this# fi if narg($5) #In context of PDN, you can ignore this# if $5>=0 tcr+=1 else any_channels=1 fi fi #In context of PDN, you can ignore this# if $influence_factor #Effect will apply if and only if influence factor is greater than 0# repeat $! l[$>] if (s==2||s>$tcr)||$any_channels #Ignore this# ss={s-1} sh $ss f. "i>$4?i:0" rm. #If alpha value is less than threshold, then alpha value is 0# {w},{h},1,1,i(#-1,x,y,0,$ss)?1 #Create new surface with alpha value# if $2 {w},1,1,1,sum(crop(#-1,x,0,0,0,1,h#-1,1,1)) #Create horizontal vector if axis direction is vertical. Value of vector is equal to the sum of columns in the newly created surface prior to this one.# else 1,{h},1,1,sum(crop(#-1,0,y,0,0,w#-1,1,1,1)) #Create vertical vector if axis direction is horizontal. Value of vector is equal to the sum of rows in the newly created surface prior to this one.# fi {w#-2},{h#-2},1,{$ss+1} #Create processing surface# eval ${-math_lib}" influence_factor="$influence_factor"; #Used for weighted average calculation# invert_factor=1-influence_factor; #Used for weighted average calculation# position="$position"; #Defines where the pixel will go# if($2, #If pixel will shift vertically, then...# for(xx=0,xx<w#-1,xx++, #Loop per pixel# nyy=h#-1-1; if(i(#-2,xx,0), N=i(#-2,xx,0); #Use horizontal vector to find sum of column# tyy=h#-1-N; #To make sure that shift do not go overbound# nyy-=tyy*position; #This is what defines the position of pixels# for(yy=h#-1-1,yy>-1,yy--, #Loop per pixel# if(N, #If N is greater than 0, then...# if(i(#-3,xx,yy), #If there is an alpha value greater than 0 in surface number 2.# N--; tnyy=influence_factor*nyy+invert_factor*yy; #Used weighted average to calculate final result# if(position==1,I(#-1,xx,ceil(tnyy))=I(#-4,xx,yy); #I had to use ceil or floor to avoid bugs# ,I(#-1,xx,floor(tnyy))=I(#-4,xx,yy); #I had to use ceil or floor to avoid bugs# ); nyy--; #Used to place pixels with alpha greater than 0 on the edge of final image# ); ,break(); #Escape xx loop when N is 0# ); ); ); ); , for(yy=0,yy<h#-1,yy++, nxx=0; if(i(#-2,0,yy), N=i(#-2,0,yy); txx=w#-1-N; nxx+=txx*position; for(xx=0,xx<w#-1,xx++, if(N, if(i(#-3,xx,yy), N--; tnxx=influence_factor*nxx+invert_factor*xx; if(position==1,I(#-1,floor(tnxx),yy)=I(#-4,xx,yy); ,I(#-1,ceil(tnxx),yy)=I(#-4,xx,yy); ); nxx++; ); ,break(); ); ); ); ); ); " k. #end result# fi endl done fi
  10. In some cases, you may want to process the image before you scale. There's sharpen and blur within PDN.
  11. Examples of thumbnails, or do you want to produce sharp thumbnails from existing image?
  12. That's too broad of a topic. Which things you would like to do?
  13. To be fair, it is impossible or difficult to get some FOSS projects to work with visual studio. I heard that there's quirks with compiling, but can't confirm. There's other solutions if anon does not want to use Visual Studio. I actually code with KDE Kate editor myself. Not completely great with generic language like c++, but very easy with scripting languages.
  14. The rectangle square fill still has bugs. But for now, I decided to step back, so that I can work on Krita.
  15. @IHaveNoName The distance is wrong. I know that's not helping. What would help in this case is a plugin that does the following: 1) Finds the minimum x where alpha is greater than 0, maximum x where alpha is, minimum y where alpha is greater than 0, where maximum y is greater than 0. 2) Use that info to find where to place image relative to the center of canvas. 3) Finally translate the image using distance and angle. This involves the usage of sin and cos and radian. Fragment Blur use some of that.
  16. Can't help, but felt like commenting on this even though I don't use codelab. I'm actually impressed at how far codelab went.
  17. Alright, another attempt. Using this test code for code[local] or code[global] filter in g'mic-qt plugin. repeat $! l[$>] to_rgb rgb2hsv channels 0 tones 2 k. erode 5 dilate 5 +area_fg 0,0 f. i>ia?0:i store. area +gradient2rgb , +f. i>0 compose_channels. + f. i>0 negate. inpaint_pde.. . rm. rv +blend shapemedian0 blend[^-1] shapeaverage0 blend average n. 0,255 rgb2hsl sh. 1 f. i>0?1 rm. hsl2rgb $area n. 0,360 +f. i0#1>0?1 . a[^0] c hsv2rgb. blend interpolation,.5 endl done Can't say I have been successful though. It's a difficult problem. The code use gradient angle and find the angle of each shape. I don't what to do on the area part, but it converts area into hsv format. Then I blended them to filter out the shape. Perhaps, I think I should do more work here. It does look promising I must admit. The next step is to try to do multiple variable to filter out shapes by if else statements. It is possible to do thinning here too. I'll find out what to do.
  18. Could you PM me the original shape image uncompressed, I believe I thought of a theoretical solution using coding and I want to code it. For anyone else reading this, I believe two for loops (current pixel, and relative pixel) and comparison should solve this.
  19. I was expecting the problem to be something like that rather than layer-by-layer shape selection. Right now, what @Red ochre is your best route for this issue. Theoretically, someone could write up a plugin that converts shapes based on searching pixels by pixels, and if it found, then that area is colored. I have pictured it in my head, and it seems do-able. It's comparison by pixels through pixels, so doable in principle. If they're of different areas, theoretically object size filtering would solve your problem, or it becomes closer to the solution. @MJW has written a plugin just for this, but it doesn't address colored background. I have written that for G'MIC, but you'd need to reduce the number of color in say that image. Either do some processing to filter out the colors, and then use @MJW plugin or reduce number of colors and use Object Size Filtering under G'MIC QT. I have attempted it, well, I guess then theory doesn't really work out, and manual solution seem to be the fastest.
  20. It been a while since I have been into this thread, but now I got something thanks to @Creed31 that indirectly gave me the idea. New Filter - Rectangle-Square Fill I will be finishing up the image mapping version of tomorrow or two, and immediately push it by then.
  21. Right now that is a temporary solution until @Rick Brewster fixes it. So, I believe you should turn it off. That being said, that is very wacky, but there is interesting generated stuff from the bug.
  22. I have recently solved my issue (mostly). Both with converting rectilnear shapes into several different shapes, and inserting rectangle. For converting rectinear into several different shape. It seems that this can do with a small vector as a reference for the larger image. It doesn't work 100%, but it can convert a lot of rectilinear shape into several rectangles in context of vectors. to_gray n 0,1 f " topleft=i(x-1,y-1); topmiddle=i(x,y-1); topright=i(x+1,y-1); middleleft=i(x-1,y); middle=i; middleright=i(x+1,y); bottomleft=i(x-1,y+1); bottommiddle=i(x,y+1) bottomright=i(x+1,y+1); F=i; if(i, if( ( (middleleft&&topmiddle&&middleright) ||(bottommiddle&&middleleft&&topmiddle) ||(middleleft&&bottommiddle&&middleright) ||(bottommiddle&&middleright&&topmiddle) ) || ( (bottommiddle&&bottomright&&middleright) ||(topmiddle&&topright&&middleright) ||(topmiddle&&topleft&&middleleft) ||(bottommiddle&&bottomleft&&middleleft) ) ,F++; ); ); F; " Here's the code for generating "grid" of rectangle and squares. #@cli rep_rand_sqrrectex: eq. to 'rep_random_square_rectangle_texture' : (+) rep_rand_sqrrectex: rep_random_square_rectangle_texture $* #@cli rep_random_square_rectangle_texture: square_dimension,_rectangle_max_length_1,_rectangle_length_2,_frequency_of_rectangle,_erode,_output={ 0=none | 1=filled_gray | 2=filled_line | 3=labeled_filled_line },_seed #@cli : Create a texture with aligned rectangle and squares. #@cli : (eq. to 'rep_rand_sqrrectex') #@cli : Default values: '_rectangle_max_length=1','_rectangle_max_length=2','_frequency_of_rectangle=1','_erode=0','_output=2','_seed=' #@cli : Author: Reptorian. #@cli : $ rep_random_square_rectangle_texture 20,3,3,2,,0 rep_random_square_rectangle_texture: skip ${2=2},${3=1},${4=1},${5=0},${6=2},${7=} if narg($7) srand $7 fi square_size=$1 if $6 square_size+=$6 fi if $1<2 error ""$"1>1==F" fi mw=${-max_w} mh=${-max_h} nvw={ceil($mw/$square_size)} nvh={ceil($mh/$square_size)} $nvw,$nvh,1,1,"x+y*w" if abs(round($2))==1&&abs(round($3))==1 error ""$"2>1||"$"3>1==F" fi msize={sqrt(sqr(round($2)))+sqr(round(abs($3)))} if $1<2 error ""$"2>1==F" fi freq={int(avg(1/$msize,$4,.5)*(iM+1))} val={iM+1} repeat round($freq) orientation={round(u(0,1))} nsl_1={round(u(1,abs($2)))} nsl_2={round(u(1,abs($3)))} min_nsl={min($nsl_1,$nsl_2)} max_nsl={max($nsl_1,$nsl_2)} if $min_nsl==1&&$max_nsl==1 max_nsl={round(u(2,abs(max($2,$3))))} fi px={round(u(0,w#-1-1))} py={round(u(0,h#-1-1))} if $orientation $min_nsl,$max_nsl,1,1,$val j.. .,$px,$py rm. else $max_nsl,$min_nsl,1,1,$val j.. .,$px,$py rm. fi val+=1 done label. 0,0 if $6 {$nvw*$square_size+1},{$nvh*$square_size+1},1,1,i(#-1,floor(x/$square_size),floor(y/$square_size)) rm.. if $6>1 f. "(x!=0&&x!=w-1&&y!=0&&y!=h-1)?(i(x-1,y-1,z,c,0,1)==i(x,y))*((i(x-1,y,z,c,0,1)==i(x,y))&&(i(x,y-1,z,c,0,1)==i(x,y))):0" if $5 erode. $5 expand_xy. {int($5/2)},0 if !($5%2) r. {w#1-1},{h#-1-1} fi fi fi if $6>2 label_fg. 0,0 fi fi I'll be integrating these two. But, I hope this helps future PDN plugins developers. There might be needing more work, but those work well most of the time.
  23. "Vector graphics are computer graphics images that are defined in terms of 2D points, which are connected by lines and curves to form polygons and other shapes." Raster graphic image processing applications has zero concept of polygon or line. You can't select shapes that way.
×
×
  • Create New...