Jump to content

Enormator

Members
  • Posts

    279
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Enormator

  1. Your curves+ must be set to alpha mode. Then your curve should look something like that

                  ___
                 /
                /
               /
    ___________/
    

    Then when only the parts of the image which you want to modify are still visible, you can run any effect, in my case Hue/Saturation. But you could also do any other effect to the sky or the part of your image, which you selected.

  2. It calculates for every pixel the difference between the pixel and the primary color. The more they are equal, the more alpha will rest. Just duplicate your layer, do my effect with a Primary color selected, maybe some fine tuning with Curves+ alpha channel and there you go affecting only this specially colored part of the image without need of feathering or anything because it's always a smooth gradient from layer to change to the original image layer.

    Download here: EffectDLL.zip

    Unzip it into your Effects directory in the Paint.NET folder.

    It will be listed under Effects -> Color

    example:

    all9f9b7.png

    1 to 2: Here i first chose the sky's color as primary with the Color Picker :ColorPicker: then I ran my effect.

    2 to 3: After that I did some alpha fine tuning with Curves+ :Curves: . And the only color effect I added to the sky was increasing saturation and a little hue adjustment :HueSaturation: .

    3 to 4: I put the original image as a layer under the modified one.

    Link to where you get Curves+

    code (Codelab):

    int dr,dg,db;
    
    void Render(Surface dst, Surface src, Rectangle rect)
    {
       PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);
    
       // Delete any of these lines you don't need
       Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
    
       ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
    
       ColorBgra CurrentPixel;
       for(int y = rect.Top; y < rect.Bottom; y++)
       {
           for (int x = rect.Left; x < rect.Right; x++)
           {
               if (selectionRegion.IsVisible(x, y))
               {
                   CurrentPixel = src[x,y];
                   dr = CurrentPixel.R - PrimaryColor.R;
                   dg = CurrentPixel.G - PrimaryColor.G;
                   db = CurrentPixel.B - PrimaryColor.B;
                   if (dr < 0)
                    dr=-dr;
                   if (dg < 0)
                    dg=-dg;
                   if (db < 0)
                    db=-db;
                   CurrentPixel.A = (byte)(255-((dr+dg+db)/3));
                   dst[x,y] = CurrentPixel;
               }
           }
       }
    }
    

    I'm currently searching for a good 16x16 png icon. Please tell me your ideas.

×
×
  • Create New...