Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:54:08+00:00 2026-06-07T04:54:08+00:00

When using my radial gradient algorithm with the Spread property set to Reflect or

  • 0

When using my radial gradient algorithm with the Spread property set to Reflect or Repeat, I get crazy ass moiré when the bands are too close together. This is normal.

What I have been trying to understand is how to figure out where this happens, or if it’s at all possible to figure this out. If I can determine some kind of “distinct<->muddled” value, I can use it as a weight to blend between the gradient color at a given pixel and a weighted average of all the colors, thereby mitigating the moiré.

I know this is quite an obscure topic, and maybe this is more of a math question, but does anybody have any ideas?

For reference, my algorithm is similar to this implementation.

Here is what my code gives now:

A radial gradient with Spread set to Reflect

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:54:09+00:00Added an answer on June 7, 2026 at 4:54 am

    Use a 3×3 filter and for each 3×3 pixel patch compute the color variance. E.g. for each two adjacent pixels in the patch ( e.g pix( 0,0 ) and pix(0,1)) get the absolute value of the difference between each color channel, square it and sum.

    So something like:

    double pixelVariance( pix a, pix b )
    {
        double variance = 0;
        variance += ( a.red   - b.red   ) * ( a.red   - b.red   );
        variance += ( a.green - b.green ) * ( a.green - b.green );
        variance += ( a.blue  - b.blue  ) * ( a.blue  - b.blue  );
        return variance;
    }
    

    Then variance for the 3×3 patch:

    double patchVariance( Patch patch )
    {
       double variance = 0;
       variance += pixelVariance( patch( 0, 0 ), patch( 0, 1 )); 
       variance += pixelVariance( patch( 0, 0 ), patch( 1, 0 )); 
       // etc.
       return variance;
    }
    

    Patches with high variance are not smooth gradients and are almost certainly going to be high moire areas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay to get started I am using Jquery-Flot to plot a radial graph I
I'm using a radial gradient as the background on my webpage, like so: background-image:
I'm currently using the following code to apply a radial gradient to the background
PROBLEM When using Imagick::newPseudoImage to create a radial gradient, this error appears in the
I'm using a radial gradient in Cairo, but I'm not getting the expected results.
I'm using a CSS code like the following one for creating a radial gradient
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
I would like to animate a radial gradient to shrink and grow the inner
Have tried various escape functions but can't seem to get the below working... .background-radial(@colour,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.