Jump to content

Reptillian

Members
  • Posts

    1,237
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Reptillian

  1. I found out how to fix it. It works, but I think I'll probably just leave the finished source code for any one that prefers the radio button interface without the brightness/contrast. And it's easier to add settings here than to use BoltBait's code. // Name: Krita Inspired Desaturation // Submenu: Color // Author: Reptillian // Title: Desaturation // Version: 1.0 // Desc: Paint.NET Desaturate filter that is based off Krita Desaturate Filter // Keywords: Lightness|Average|Min|Max|Grayscale|Desaturate // URL: https://forums.getpaint.net/ // Help: #region UICode RadioButtonControl Amount1 = 0; // [1] Desaturation Method|Lightness|Luminosity (ITU-R BT.709)|Luminosity (ITU-R BT.601)|Average|Maximum|Minimum #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((selection.Right - selection.Left) / 2) + selection.Left; int CenterY = ((selection.Bottom - selection.Top) / 2) + selection.Top; ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; byte D = 0; int R = (int)CurrentPixel.R; int G = (int)CurrentPixel.G; int B = (int)CurrentPixel.B; switch(Amount1) { case 0: D = (byte)((Math.Max(R,Math.Max(G,B))+Math.Min(R,Math.Min(G,B)))/2); break; case 1: D = (byte)(.2126*R+.7152*G+.0722*B); break; case 2: D = (byte)(.2989*R+.5870*G+.1140*B); break; case 3: D = (byte)((R+G+B)/3); break; case 4: D = (byte)(Math.Max(R,Math.Max(G,B))); break; case 5: D = (byte)(Math.Min(R,Math.Min(G,B))); break; } CurrentPixel = ColorBgra.FromBgra(D,D,D,CurrentPixel.A); dst[x,y] = CurrentPixel; } } }
  2. Looks like Luminosity Rec.701, Min, Max are the only missing options in your plugin.
  3. The problem now? Everything turns black. This is basically a simple filter attempt to de-saturate filter based on options found in Krita. // Name: Krita Inspired Desaturation // Submenu: Color // Author: Reptillian // Title: Desaturation // Version: 1.0 // Desc: Paint.NET Desaturate filter that is based off Krita Desaturate Filter // Keywords: Lightness|Average|Min|Max|Grayscale|Desaturate // URL: https://forums.getpaint.net/ // Help: #region UICode RadioButtonControl Amount1 = 0; // [1] Desaturation Method|Lightness|Luminosity (ITU-R BT.709)|Luminosity (ITU-R BT.601)|Average|Min|Max #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((selection.Right - selection.Left) / 2) + selection.Left; int CenterY = ((selection.Bottom - selection.Top) / 2) + selection.Top; ColorBgra PrimaryColor = EnvironmentParameters.PrimaryColor; ColorBgra SecondaryColor = EnvironmentParameters.SecondaryColor; int BrushWidth = (int)EnvironmentParameters.BrushWidth; ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; byte D = 0; int R = (int)PrimaryColor.R; int G = (int)PrimaryColor.G; int B = (int)PrimaryColor.B; switch(Amount1) { case 0: D = (byte)((Math.Max(R,Math.Max(G,B))+Math.Min(R,Math.Min(G,B)))/2); break; case 1: D = (byte)(.2126*R+.7152*G+.0722*B); break; case 2: D = (byte)(.2989*R+.5870*G+.1140*B); break; case 3: D = (byte)((R+G+B)/3); break; case 4: D = (byte)(Math.Max(R,Math.Max(G,B))); break; case 5: D = (byte)(Math.Min(R,Math.Min(G,B))); break; } CurrentPixel = ColorBgra.FromBgra(D,D,D,CurrentPixel.A); dst[x,y] = CurrentPixel; } } }
  4. Right now, I am trying to convert a document from one program into pdn format with minimum tradeoff, and to do that, I would need to provide gradient maps. How can I create gradient map preset from these images (separated by alpha) easily with minimum info loss? The width of the image is 256 meaning that they corresponds to 8-bit lightness value. I would like to use those images, and assign gradient map to another image. EDIT: I attempted to copy values, and tried to get the closest match to one of the 2 series using @pyrochild Gradient Map plugin, it wasn't very optimal to say for the least. I do have a workaround to my problem though as I'm making replica of gradient maps used for a game by solving them. I believe I would need to use Color Adjustment just like I did with the program. They do offer preset. EDIT: Sorry about this, but one more thing. I would definitely need to desaturate to hsl l* values or lightness values before applying gradient map. No easy way to do this in PDN. Actually, I'm just gonna make the plugin.
  5. **Raises hand** What's the difference? EDIT - I see the difference. Never mind, insomnia.
  6. I usually work with vector softwares for this sort of thing. I set up the document in inches, and place them into the document, then I use Scribus to prepare print (that may be overkill when all you want is the picture). I never printed from a raster graphic program again after learning about this.
  7. There could be legacy pdn export mode as a option. At each layer, new blending mode will instead be a flattened copy then remove the blending mode layer. Normal mode is not gonna solve everything. Also for the OP, doing something in head and programming is different. Very different. Source - I coded over 20 blending modes for Krita like XNOR, OR, Modulo, Reflect, IFS Illusion modes.
  8. News, I will not be doing filters in a good while. Last update for now - https://github.com/dtschump/gmic-community/pull/196 Stitch is the new filter on 2.7.0.
  9. 2.7.0 seem to be coming according to the G'MIC maintainer at discuss.pixls.us.
  10. Well, looks like the tiles_shape will be on hold. I decided to make it even faster, and awaiting skip bug fix on g'mic. Meanwhile, I made the g'mic version of object pruner though it might need more work. Is anyone interested into alpha based on shape separation and their size? I might extend the g'mic version to support filter object based on mode of colors rather than plain black and white. I guess Object Pruner can be extended this way, but I can't speak for the developer of it. @MJW Decided to call since I'm sharing idea here, and made something based on the principle of the Object Pruner plugin. Early code development of g'mic version of object pruner (not representative of current code). I also can make the alpha depending on pixel size. I'm sure that can be of use. vv is just going to be used to determine if alpha variance is the same, and therefore skip the code if variance is zero. I can't explain the begin thing or the >i in f blocks, I was just testing values and seeing how they work, but I don't know how as I copied from blend_shapeaverage0 code found in user.gmic. The rest is easier to understand. f is basically equivalent to function most of the time. Label assigns unique number to shapes of repeating values, and shapes are also treated as object. rm removes layers. channels is used to extract a channel. sh created a linked copy where specified number is a channel or ranges of channel. val_a=0 val_b=.01 minv={min($val_a,$val_b)} maxv={max($val_a,$val_b)} vv=0 +channels {s-1} f. i==0?0:1 . f[2] "begin(A = resize([ 0,(s-1)/s ],s,3));I+A" norm[2] round[2] 0.01 label[2] 0 {iM+1},1,1,{0,1} f[1] ">i(#3,i(#2,x,y,z,0),0,0,c)+=i;i" map[2] . rm[1,3] n. 0,100 sh[0] {s#0-1} f. ma=$minv*iM#-2;mb=$maxv*iM#-2;(i#-2<ma)||(i#-2>mb)?0:i rm[1,2]
  11. New filter is in work Based off TR Tiled Pixels. New features would be: - Custom tile width and height - Subpixel processing - Rotation of shape / Flip Shape - Alter how much shape fill the tile - Support for custom shapes, you have to make a new layer and use grays only for this(more on that when released to github) -20+ shapes support It's a bit slower than @TechnoRobbo filter when subpixel processing are done. I haven't looked at his algorithm or source code, but this filter of mine is based off weighted averaging using shape, and the last channel is treated as shape cropped. GUI filter will convert to rgba if 3 channels are used, but that only affects GIMP.
  12. More updates coming. New Filter named Stitch. Based off the principles of @pyrochild Stitch Paint.NET plugin. There's more features to the G'MIC version that I have made than the stitch paint.net plugin. You can have 12 stitch angle, make stitching random or uniform, anti-aliasing, change subpixel processing level, change the repeat level. - Here how it looks like below -
  13. Even though 2.7.0 is not available for Paint.NET and you won't see this update, during the meantime, I"ll post changes that'll be coming. New Changes: 50 new palettes, fixes to distortion filters - For details - Fixes to distortion filters, and 50 new palettes #196 EDIT: Next up, I"ll probably make a way to export those palettes. But, it's more likely I"ll work on modulo and continue into developing the concrete texture.
  14. Here's something I thought of in G'MIC-QT. Open G'MIC-QT. Go to code[global]/code[local]. Paste this code. input_glob "" #Type in your location (No spaces allowed, not my fault or null54 fault)# r2dx 200%,5 #Resize 200% by bicubic interpolation# fx_smooth_bilateral 42.7,13.2,1,0 #Spatial Variance, Value Variance, Iteration, Channels and Color Space Option# output {name},{format} #Please change name to your desire, and use the right format# What this does is import images, and then output images. They're not applied to layers.
  15. 2.7.0 when? That's the version that actually updates as evidence by removal of my own Spiral Matrix Transform (replaced with Testing->Joan Rake version). Also, G'MIC seem to be getting AI learning though it is being developed. - https://mobile.twitter.com/gmic_ip/status/1148684715047694336
  16. ImageMagick or G'MIC as a cli app. They can perform batch editing. Plugins cant access more than 1 layer. So, the alternative are these two.
  17. Decided to extend my existing Color Modulo Texture after reading more of @MadJik thread. I was basing my older version off the one that I had. Now, here's the cli options. #@cli rep_color_modulo_texture: 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ _diagonal_flip= { 0=not flipped | 1 = flipped },_subpixel_processing_level>0,0<=_interpolation<=5,0<=_colorspacemode<=12,_contain_alpha= { 0=no_alpha | 1=alpha },\ 0<=_channel_num<=4,0<=_channel_num<=4,0<=_channel_num<=4,0<=_channel_num<=4 And a image to go with the upgrade of my own Color Modulo Texture. That's CMYK color modulo texture with everything centered and no angle change using continuous divisive modulo mode. Beautiful, huh? For those who wants the code early before G'MIC can actually update again : @cli rep_colmt: (eq. to rep_color_modulo_texture) rep_colmt: rep_color_modulo_texture $* #@cli rep_color_modulo_texture: 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ 0<=_modulo_method<=5,_maxmod>0,_endmodvalue>0,0<=_angle<=360,_value_shift>0,_centered= { 0=Not centered | 1=Centered },_negate_mod= { 0=normal | 1=inverted },_normalize_bool= { 0=Do not Normalize | 1=Normalize },\ _diagonal_flip= { 0=not flipped | 1 = flipped },_subpixel_processing_level>0,0<=_interpolation<=5,0<=_colorspacemode<=12,_contain_alpha= { 0=no_alpha | 1=alpha },\ 0<=_channel_num<=4,0<=_channel_num<=4,0<=_channel_num<=4,0<=_channel_num<=4 #@cli: Inspired by MadJik's Color Modulo Texture for Paint.NET, this is a extension of that filter converted into G'MIC form. New features is being able to change color space, allow alpha, anti-aliasing... rep_color_modulo_texture: repeat $! l[$>] lcmod_1=$38 lcmod_2=$39 lcmod_3=$40 lcmod_4=$41 cs=$36 alp=$37 diag=$33 interpolation=$35 subpixel=$34 subpixel+=1 tc={$cs!=3?3+$alp:4} iw={w} ih={h} maxv={max(w,h)} sd={min(w,h)/max(w,h)} sx={w<h?$sd:1} sy={h<w?$sd:1} msx={.5*$sx} msy={.5*$sy} center=1 f 0 r {$interpolation?$subpixel*100:100}%,{$interpolation?$subpixel*100:100}%,100%,$tc ($lcmod_1,$lcmod_2,$lcmod_3,$lcmod_4) l. s x ti=$! remove_duplicates if $!!=$ti v + error "Invalid channel inputs!" v - fi a x endl repeat $tc sh[0] {i(#1,$>,0)} done rm[1] f[1] ang=pi*($4/180);ix=(x/w)-.5;iy=(y/h)-.5;ix*=$sx;iy*=$sy;IX=ix*cos(ang)-iy*sin(ang);IX+=!$6?$msx;IX*=$maxv;ix=IX;ix/$subpixel abs[1] modf[1] $1,$2,{$3/$2} if {$8&&($1<2)} +[1] {$3<$2?$3} fi if $7 negate[1] fi temp={im#1} -[1] $temp modf[1] 4,{iM#1},$5 +[1] $temp f[2] ang=pi*($12/180);ix=(x/w)-.5;iy=(y/h)-.5;ix*=$sx;iy*=$sy;IY=ix*sin(ang)+iy*cos(ang);IY+=!$14?$msx;IY*=$maxv;iy=IY;iy/$subpixel abs[2] modf[2] $9,$10,{$11/$10} if {$16&&($9<2)} +[2] {$11<$10?$11} fi if $15 negate[2] fi temp={im#2} -[2] $temp modf[2] 4,{iM#2},$13 +[2] $temp f[3] ang=pi*($20/180);ix=(x/w)-.5;iy=(y/h)-.5;ix*=$sx;iy*=$sy;IX=ix*cos(ang)-iy*sin(ang);IY=ix*sin(ang)+iy*cos(ang);IX+=!$22?$msx;IX*=$maxv;IY+=!$22?$msx;IY*=$maxv;ix=IX;iy=IY;($diag?(abs(ix)+abs(iy)):abs(abs(ix)-abs(iy)))/$subpixel modf[3] $17,$18,{$19/$18} if {$24&&($17<2)} +[3] {$19<$18?$19} fi if $23 negate[3] fi temp={im#3} -[3] $temp modf[3] 4,{iM#3},$21 +[3] $temp if $tc==4 f[4] ang=pi*($28/180);ix=(x/w)-.5;iy=(y/h)-.5;ix*=$sx;iy*=$sy;IX=ix*cos(ang)-iy*sin(ang);IY=ix*sin(ang)+iy*cos(ang);IX+=!$30?$msx;IX*=$maxv;IY+=!$30?$msx;IY*=$maxv;ix=IX;iy=IY;(!$diag?(abs(ix)+abs(iy)):abs(abs(ix)-abs(iy)))/$subpixel modf[4] $25,$26,{$27/$26} if {$32&&($25<2)} +[4] {$27<$26?$27} fi if $31 negate[4] fi temp={im#4} -[4] $temp modf[4] 4,{iM#4},$29 +[4] fi k[0] if $interpolation&&($subpixel>=2) r $iw,$ih,100%,100%,$interpolation fi if $cs!=3 if $cs!=0 sh 0,2 fi if $cs==1 ryb2rgb. elif $cs==2 cmy2rgb. elif $cs==4 hsi82rgb. elif $cs==5 hsl82rgb. elif $cs==6 hsv82rgb. elif $cs==7 lab82rgb. elif $cs==8 lch82rgb. elif $cs==9 yiq8rgb. elif $cs==10 yuv82rgb. elif $cs==11 yuv82rgb. elif $cs==12 xyz82rgb. fi if $cs!=0 rm. fi else cmyk2rgb fi endl done For some reason, rep_colmt didn't work. Paste this to userxxxx.gmic, then go into code[local] and paste this to get the result like I had - rep_color_modulo_texture 3,255,64,0,0,1,0,0,3,255,64,0,0,1,0,0,3,255,64,0,0,1,0,0,3,255,64,0,0,1,0,0,1,1,3,3,1,0,1,2,3
  18. You're probably not looking into technical explanation, but just in case... Inches works by scaling based on pixels per inches. 1 inches = 300 pxs in 300 ppi. If you set your document to 96 ppi, 1 inch = 96 pixels. Pixel size aren't actually universal. 1 pixel is meaningless outside of the digital world.
  19. I want to make sure of this. Is it worth improving Vibrato and OOBS? I don't feel like they're used all that much. I know exactly how I can improve Vibrato, but it seem fine for one color image as you can get abstract there. I'm about to extend Modulo Texture further.
  20. @Rick Brewster Sorry about this, but the thread doesn't seem to be solved at this point as the approach of "try plugins firsr, and if not, then try other softwares that actually works with these features better as a workaround" didn't solve. Should the OP expect improvements?
  21. @toe_head2001 already offered you suggestions that gets around PDN limitation with curves. They didn't seem to work. It is unlikely curves tool will be upgraded soon(I get that impression). At that point, you'd have to look outside the box.
  22. On 1, and 2, you're probably better off with a vector graphic software if Paint.NET limits does bother you. Inkscape/Illustrator/Designer all allows you to edit lines to a far greater degree than what's offered in PDN plugins.
  23. New updates will come soon. Just bug fixes, and removal. These changes will come by next week as it's Saturday. Right now, this update isn't here yet, but letting y'all know. Spiral Matrix Transform has been removed. It is obsoleted by Joan Rake's Spiral Matrix Transform. That also works on images bigger than 4096x4096. So, no reason to keep this anymore. Logarithmic Distortion has been fixed. There should be no crash. Nebulous has further fixes, and a slight upgrade.
  24. Nah, I don't think I"ll be interested into doing emboss. I'm having legit trouble trying to create the bias factor, and normalizing it. So, That's on hold. As a matter of fact, I do have a workaround to that. Now, I think I actually got something here, but it's different. Paste it within code[global] or code[local] to see how this works. repeat $! l[$>] Sublevel=1 Angle_Stitch=75 Thickness=1 Interpolation=3 Intensity=100 Boundary=1 iw={w} ih={h} ang={pi*($Angle_Stitch/180)} ang2={pi*(($Angle_Stitch+90)/180)} r {($Sublevel+1)*100}%,{($Sublevel+1)*100}%,100%,100%,1 {w},{h},1,1,sur=x*cos($ang)+y*sin($ang);floor(sur/($Thickness*($Sublevel+1))) {max(1,round(iM,1,1))},1,1,1,u(1) round. map.. . rm. -. {iM/2} f. i<0?-1:1 repeat s#0 sh[0] $> f. "sx="$Intensity"*cos("$ang2")*i#1;sy="$Intensity"*sin("$ang2")*i#1;sx+=x;sy+=y;i(sx,sy,z,c,"$Interpolation","$Boundary")" rm. done rm. r {$iw},{$ih},100%,100%,{$Interpolation} endl done Based off the principle of @pyrochild Stitch plugin. I will be adding more options, and enabling multiple angles(not just two).
×
×
  • Create New...