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 748969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:22:52+00:00 2026-05-14T14:22:52+00:00

I’m looking to make an image that’s just noise, maybe something like this: (source:

  • 0

I’m looking to make an image that’s just noise, maybe something like this:

alt text
(source: loriswebs.com)

Ideally I’d like to be able to change the colour as well. Any ideas on how to generate this?

  • 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-05-14T14:22:53+00:00Added an answer on May 14, 2026 at 2:22 pm

    It’s fairly straightforward to generate random noise. You can accomplish this pretty easily with some of PHP’s image libraries, including the GD functions. I’m sure it would be similar in ImageMagick.

    If you wanted to generate completely random noise, you could use random values for every color and every pixel. That might look something like this with GD:

    //random colored noise
    $x = 150;
    $y = 150;
    $im = imagecreatetruecolor($x,$y);
    for($i = 0; $i < $x; $i++) {
        for($j = 0; $j < $y; $j++) {
            $color = imagecolorallocate($im, rand(0,255), rand(0,255), rand(0,255));
            imagesetpixel($im, $i, $j, $color);
        }
    }    
    header('Content-Type: image/png');
    imagepng($im);
    

    Generates this: alt text

    However, the example image that you posted clearly doesn’t look like completely random color noise. It seems more like an arbitrary choice between one of two colors, either a somewhat-grey pixel or a somewhat-colored pixel. You could accomplish that more like this:

    //two-color random noise
    $x = 150;
    $y = 150;
    $im = imagecreatetruecolor($x,$y);
    $color1 = imagecolorallocate($im, 200, 240, 242);
    $color2 = imagecolorallocate($im,220,220,220);
    imagefill($im,0,0,$color1);
    for($i = 0; $i < $x; $i++) {
        for($j = 0; $j < $y; $j++) {
            if (mt_rand(0,1) == 1) imagesetpixel($im, $i, $j, $color2);
        }
    }
    header('Content-Type: image/png');
    imagepng($im);
    

    Generates this: alt text

    Your example seems a bit more complex still, with the pixels seeming to appear in small groups to produce a blockier appearance. You could emulate that by adjusting the loop logic if you wanted, or coloring small squares instead of individual pixels.

    An interesting thing about this type of generation is that you can actually see the breakdown of the rand() function on Windows platforms if you use it instead of mt_rand(). Discernible patterns can develop in the noise due to limitations in that function/platform combination.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I know there's a lot of other questions out there that deal with this
I have some data like this: 1 2 3 4 5 9 2 6
I have a jquery bug and I've been looking for hours now, I can't
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.