: Is it possible to generate 'random' pixels in Photoshop? 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
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?
More posts by @Connie430
3 Comments
Sorted by latest first Latest Oldest Best
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:
Applying noise to a white canvas gives a peak at 255 only (50% of all pixels)
Applying noise to a black canvas gives a peak at 0 only (50% of all pixels)
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.
A 5 second google search found this:
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.
Photoshop isn't really meant for this kind of randomness as it is meant for control.
But here's a workaround without any scripting:
Select the Pencil Tool
Go into the brush options
Select 'Color Dynamics'
Crank up Foreground/Background Jitter, Hue Jitter, Saturation Jitter, and Brightness Jitter
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.