Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I want to generate an area of random pixels in Photoshop. By random, I mean the 24-bit RGB values of the pixels vary uniformly over the range 0x000000 - 0xffffff. The opacity should not vary. I've experimented with the Add Noise filter, but I can't get anything like the desired effect. Is this possible with Photoshop?

share|improve this question
1  
Back in the day you could generate weird pixel images buy going to OPEN RAW > then select a non-image file (like an .exe or something). Not sure if that still works in the later versions. –  DA01 May 8 '12 at 15:19
2  
Can you explain, in detail, why the noise filter in not appropriate? I want to point out that your definition of "random" (uniform variation) appears to be a unique definition of the term. Also: does "opacity" at a pixel scale have meaning in this context? –  horatio May 8 '12 at 15:54
    
The noise filter is not appropriate because it doesn't do what I've described. Opacity does have a meaning in this context: if pixels are not opaque the distribution will be skewed based on the background colour. –  fredley May 8 '12 at 17:53
1  
The Uniform Distribution is a statistical distribution, that's uniform. I don't want it to be influenced by what's underneath, hence the requirement that all the pixels are opaque. –  fredley May 8 '12 at 20:14
1  
That's fine. He should edit his question with clarifications he made in all the comments. It sounds like the only problem here is that the noise filter requires a background color. –  horatio May 15 '12 at 15:00
show 11 more comments

3 Answers

I've just used Add Noise, set to "Uniform" in an empty white document and it looks like a uniform distribution to me, with a mean of 127 as expected, when I look at the histogram (after refreshing it). I tried both default (RGB) and monochromatic.

Edits: The histogram shows a peak value at 255 when starting with a white document. I overlooked this -- difficult to see against the right hand edge of the histogram.

Further experimentaion showed:

  1. Applying noise to a white canvas gives a peak at 255 only (50% of all pixels)
  2. Applying noise to a black canvas gives a peak at 0 only (50% of all pixels)
  3. Applying noise to a mid-grey or coloured canvas gives peaks at 0 and 255 (together, 50% of all pixels)

It seems that Apply Noise returns 50% pixels at low (0) and/or high (255) ends of the range, dependent on the contents of the layer. The remaining 50% pixels appear to be uniformly distributed across the remaining range (0-254, 1-254, or 1-255 depending on input).

I don't think there is any way of easily fixing this output to give what you're looking for. I think layering clipped multiple versions of (1) and (2) above could reduce the peaks, but not eliminate them entirely. Probably time to roll your own code.

share|improve this answer
    
Don't you get peaks on the histogram at 0 and 255? I certainly did in my experiments. –  fredley May 15 '12 at 14:06
    
Yes, edited answer with more findings. –  e100 May 16 '12 at 8:31
add comment

A 5 second google search found this:

http://www.ps-scripts.com/bb/viewtopic.php?f=16&t=3998

Aside from a PS Script I would say you'd need to use Processing, OpenFrameworks or probably the easiest choice NodeBox.

share|improve this answer
    
If I'm going to have to resort to code I'll just use python/PIL to generate some large images of noise and import them. –  fredley May 9 '12 at 9:08
    
NodeBox is built on Python –  Ryan May 9 '12 at 10:38
add comment

Photoshop isn't really meant for this kind of randomness as it is meant for control.

But here's a workaround without any scripting:

  1. Select the Pencil Tool

  2. Go into the brush options

  3. Select 'Color Dynamics'

  4. Crank up Foreground/Background Jitter, Hue Jitter, Saturation Jitter, and Brightness Jitter

  5. Change the background/foreground color so it isn't just black and white.

This will generate some random values. It won't be 100% random, but you can play around with it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.