Jump to content

Enormator

Members
  • Posts

    279
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Enormator

  1. triangulargradient.png

    Makes a triangular gradient in selection (or on the full image when nothing is selected) from primary to secondary color (including alpha).


    Here is the (quite simple) CodeLab source:

    Spoiler
    
    #region UICode
    int Amount1=0;	//[0,100]Slider 1 Description
    int Amount2=0;	//[0,100]Slider 2 Description
    int Amount3=0;	//[0,100]Slider 3 Description
    #endregion
    
    void Render(Surface dst, Surface src, Rectangle rect)
    {
        // Delete any of these lines you don't need
        Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
        long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left);
        long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top);
        ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
        ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;
        int BrushWidth = (int)EnvironmentParameters.BrushWidth;
        double m,topborder;
        int locx,locy;
    
        ColorBgra CurrentPixel;
        for (int y = rect.Top; y < rect.Bottom; y++)
        {
            locy = y-selection.Top;
            for (int x = rect.Left; x < rect.Right; x++)
            {
                CurrentPixel = src[x,y];
                locx = x-selection.Left;
                m = (((double)selection.Bottom-selection.Top)/(selection.Right-selection.Left));
                topborder = m*locx;
                CurrentPixel.R = (byte)((PrimaryColor.R*locy+SecondaryColor.R*(topborder-locy))/topborder);
                CurrentPixel.G = (byte)((PrimaryColor.G*locy+SecondaryColor.G*(topborder-locy))/topborder);
                CurrentPixel.B = (byte)((PrimaryColor.B*locy+SecondaryColor.B*(topborder-locy))/topborder);
                CurrentPixel.A = (byte)((locy<=topborder ? ((PrimaryColor.A*locy+SecondaryColor.A*(topborder-locy))/topborder) : 0));
                dst[x,y] = CurrentPixel;
            }
        }
    }

     

     

    I did this because I needed it but you still may tell me what you think about it.

    I use PdN 3.36 and have no clue what the recent version of PdN will say about that dll. If it doesn't work, just use codelab (if that still exists, don't know, was not here for quite a while)

     

    TriangularGradient.zip

     

  2. I remember there was an average blur plugin lying about that gave the average color of your canvas. Maybe it can help?

    [Edit] There, in KrisVDM's pack:

    viewtopic.php?f=16&t=22881&hilit=average+blur

    I already got helped with it in the Plugin Developer Central but I'm in the mid of my degree tests right now, so probably there won't be anything done until next week.

    Duuude, this looks sweet - I've been wanting something that could do this! I'll download it after a week or so has passed and you've had time to fix any bug reports that come in. 8)

    Cheers!

    I think at the moment this plugin is just too simple to have serious bugs. It's made with codelab and not very complicated.

    Thank you all for the feedback :)

  3. What are the edges of the entire image? "rect" is only a small part of the image, isn't it?
    You can get all the rects of the selection via

    Rectangle[] selectionScans = this.EnvironmentParameters.GetSelection(src.Bounds).GetRegionScansInt();
    

    To access every selected pixel I would then have to write a triple loop like this?

    for (int i = 0; i < selectionScans.size(); i++)
    {
       for (int y = selectionScans[i].Top; y < selectionScans[i].Bottom; y++)
       {
           for (int x = selectionScans[i].Left; x < selectionScans[i].Right; x++)
           {
               //add this pixel to the arithmetic mean calculation
           }
       }
    }
    

    and to access ie the red value of a pixel would I then use this?

    selectionScans[i][x,y].R
    

  4. process the entire image

    What are the edges of the entire image? "rect" is only a small part of the image, isn't it?

    Couldn't it happen, that the second rendering thread tries to read the color before it the first is ready with calculating it? I could set a flag for being ready, but how do I wait for the flag? Like this?

    while(!ready){}

  5. You are not misunderstanding anything as it seems. I'm working on it :)

    EDIT:

    This seems to be more difficult than I thought (maybe even impossible) due to the multithreaded rendering architecture of PdN. Would it also be a good thing to have a color wheel where you can select a color and see how it looks like?

    EDIT2:

    color wheel added in v1.1

  6. Adjustments -> invertaroundprimcol377a1.png invert around primary color

    version 1.1

    You know "invert colors"? This plugin is quite similar except that you can invert colors around other colors. Look at the examples to understand.

    If you want to make this picture look stamped-in instead of stamped-out, you can just use the normal invert colors effect

    ex017fc96.png __ :InvertColors: invert colors__> ex02a6e43.png

    But on this picture, it would be impossible to do that because it would look like this:

    ex117f4cd.png __ :InvertColors: invert colors__> ex123b7e7.png

    Now this plugin comes in handy. You take the color picker :ColorPicker: and select the middle color (like in the background of the picture) as primary color. The you use Adjustments->invertaroundprimcol377a1.pnginvert around primary color

    ex117f4cd.png __invertaroundprimcol377a1.pnginvert around primary color__> ex13fc2ee.png

    Another example: A middle orange has been selected as primary color. Note how every bump is inverted.

    ex21bb213.png __invertaroundprimcol377a1.pnginvert around primary color__> ex2314c7b.png

    With normal color inversion :InvertColors: the outcome would be like this: ex221f50a.png

    :idea: A usage tip: If you don't know the middle color of your image, just resize it to 1x1 px and then colorpick the only pixel left. Undo the resize and then you can easily use my effect.

    Let me see, what you use it for! I'm looking forward to other creative using ideas for this plugin :mrgreen:

    History:

    v1.1

    added color wheel

    invert_around_primcol.zip

  7. ^ bump

    I only used normal blend mode because my plug-in creates transparency on the top layer, so the original parts, which you didn't want to modify should shine through from below.

    Please read the forum rules. Especially the part about bumping threads. I think the correct procedure in accordance to the forum rules would have been to... ask me via pm? I must say, that I don't like that part of the rules very much...

  8. It would be nice, if the black fields of the board would have a different color from the black pieces and be solid. So everyone could more easily do individually styled images. The colors of the pieces are also not so easy editable if you would for example want a texture to fill them, you would want to select all white pieces at once and do a photo flood fill. But I don't know a good solution for that atm... white pieces just should be white :P maybe white rgb(254,254,254) in contrast to the white of the board rgb(255,255,255)

    I also like chess ;)

  9. Hey dudes!

    I've got a new idea for the SaturationZeroProblem:

    An Interface with 3 Sliders whcih set how important for the difference the channel should be. (i.e. with Value Importance = 100% and both other = 0% only the brightness of the pixel would be important)

    But you can't set the Hue importance but only the maximal hue importance. And the less Saturation a pixel has the less Hue will be important. So there would be no sharp edges.

    Anyone understood what I just said?

    Please feedback (good idea/understood nothing/bad idea)

    And I'm still searching for a good icon 16x16 png (alpha allowed)

  10. from the pic post thread:

    Only image I didn't create were the "Google Search" and "I'm Feeling Lucky" buttons
    wit...can you actually use these (buttons)?

    Google only asks your browser to create buttons with the right letters on it. So the button design belongs to the owner of the rights of your browser. But I don't think, that Microsoft, Mozilla or anyone would make trouble about that.

  11. ContestGoogleEnormator28cae_thumb.jpg

    I used the google logo from http://google.com and this pic of the cell phone http://www.roverpowered.com/~booyaah/tayloredtech/images/6230.jpg. The site which used the pic (http://www.tayloredtech.co.uk/) seems to be dead now.

    Note that I payed attention to the display of the Nokia 6230. The inserted pic has a resolution of 128² pixels, which is exactly what the cell phone has.

    EDIT: Due to hosting problems with myimg.de I had to reupload it. Alternate Link:

    Contest_Google-Enormator.png

×
×
  • Create New...