Jump to content

Scintillate (new 24th Aug 13) - may hurt your eyes!


Recommended Posts

omgpOjb.png
DukOQck.png
Scintillate: Alternately inverts the colours of an image in a tiltable pattern. At small sizes gives a strange moving effect that will probably give you migraine!

Good results on spectrum gradients and interesting patterns when run repeatedly (with different settings) on the same image.
Note: Image resoloution affects the 'scintillation' and jpeg compression generally wipes it out. Also resizing down is problematic. These images will probably change if you resize your browser.

Have fun!

Found under Effects/Stylize. Dll name = scintillate.



Nearly forgot the code:

Hidden Content:
/* =================================================== */
/*     */
/* Scintillate    */
/* (c) 2013 Red Ochre     */
/*     */
/* Description: inverts alternating pixels      */
/*     */
/* ========================================== ======== */

// Name: Scintillate
// Author: Red ochre (John Robbins)
// Submenu: Stylize
// URL: http://www.getpaint.net/redirect/plugins.html
// Title: Scintillate                     Aug 2013        Red Ochre


#region UICode
byte Amount1 = 0; // [1] Pattern|alternate squares|micro-lattice
double Amount2 = 0; // [0,90] Angle
int Amount3 = 20; // [1,100] Size
bool Amount4 = false; // [0,1] Offset pattern
bool Amount5 = false; // [0,1] Invert alpha
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{  
    Rectangle sel = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
    int H = sel.Bottom - sel.Top;
    int W = sel.Right - sel.Left;
    ColorBgra cp;    // current pixel
    int B,G,R,A;
    double angle = Math.PI * Amount2/180;
    int K = Amount3;
    double deg90 = Math.PI /2;
    double sina = Math.Sin(angle);
    double sinb = Math.Sin(deg90 - angle);
    double cosa = Math.Cos(angle);
    double cosb = Math.Cos(deg90 - angle);
    int Ox = (int)(sel.Left + (W/2));
    int Oy = (int)(sel.Top + (H/2));

    for (int y = rect.Top; y < rect.Bottom; y++)
    {
        for (int x = rect.Left; x < rect.Right; x++)
        { 
            cp = src[x,y];B = cp.B;G = cp.G;R = cp.R;A = cp.A;
            
          
            int cX =   x  - Ox;   
            int cY =   y  - Oy; 
            double X = ((cX * cosa) + (-cY * cosb));//will be +ve and -ve
            double Y = ((cX * sina) + (cY * sinb)) ;
            
            if(angle == 0){X = cX;Y = cY;}//to get around odd pattern caused by inaccuarcy in trig funcs?

            X = X/K;Y = Y/K;//grid size 
         
            bool Inv = false;
           
            if(Y < 0){Y = -Y + 1;}
            if(X < 0){X = -X + 1;}
          switch(Amount1)
            {case 0:
             if(Y%2 < 1){X = X + 1;}
             if(X%2 < 1){Inv = true;}
             break;
             case 1:
             if(X%2 < 1||Y%2 < 1){Inv = true;} 
             break;
            }
           
            if(!Amount4 && Inv){B = 255 - B;G = 255 - G;R = 255 - R;if(Amount5){A = A - 255;}} 
            if(Amount4 && !Inv){B = 255 - B;G = 255 - G;R = 255 - R;if(Amount5){A = A - 255;}} 

            // re assemble
            cp = ColorBgra.FromBgra( Int32Util.ClampToByte(, Int32Util.ClampToByte(G), Int32Util.ClampToByte(R), Int32Util.ClampToByte(A));
            dst[x,y] = cp;
        }
    }
}


  • Upvote 2

 

Red ochre Plugin pack............................................................... Diabolical Drawings

 

PdnForumSig2.jpg

Link to post
Share on other sites

Interesting effect!  Thanks Red.

Link to post
Share on other sites

EER, Drew',Pixey, BBQ & TR - many thanks for the support!

 

EER & TR - no-one has noticed my deliberate mistake in the code yet? :D

 

Hidden Content:

(I didn't invert the alpha correctly - really makes no difference as A = 0 is probably all that's needed.)

 

Red ochre Plugin pack............................................................... Diabolical Drawings

 

PdnForumSig2.jpg

Link to post
Share on other sites
  • 4 weeks later...

Seerose, this is an English only forum.  We mean no disrespect, but the moderators are all English speakers and it's more difficult to moderate posts in other languages.  I translated your post, but please keep that in mind in the future.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to post
Share on other sites

Seerose, this is an English only forum.  We mean no disrespect, but the moderators are all English speakers and it's more difficult to moderate posts in other languages.  I translated your post, but please keep that in mind in the future.

Okay, thank you.  :scanner: 

Live as if you were to die tomorrow. Learn as if you were to live forever.

Gandhi

 

mae3426x.png

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.

×
×
  • Create New...