Skip to content

Instantly share code, notes, and snippets.

@jcamenisch
Created June 8, 2012 00:09
Show Gist options
  • Save jcamenisch/2892526 to your computer and use it in GitHub Desktop.
Save jcamenisch/2892526 to your computer and use it in GitHub Desktop.
Add noise to a background using modest-sized tile, but preventing any noticeable repetition
html {
background-color: #eed;
background-image: url(noise.png), url(noise.png), url(noise.png);
background-size: 79px 79px, 101px 101px, 73px 73px;
background-position: 0 0, 5px 5px, 11px 11px;
}
@jcamenisch
Copy link
Author

noise.png should be 79px by 79px, and lighter than normal, as it will be layered three times. My image of choice has noise in the alpha channel, so that overlapping pixels will combine opacities for more varied results. The color of the image is saturated, full-color noise, so that overlapping pixels combine to produce variety of hue and saturation. The low overall opacity keeps the colors from being noticeable.

@jcamenisch
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment