Randomly Generated Pixels

Hi!
I want to create a script that creates random (or near random) values for every single pixel of a document, similar to the "Add Noise..." filter, but with more control, such as "only b/w", "only grey", "all RGB" and "all RGB with alpha" and maybe even control over the probability distribution. Any idea how this could be tackled? Selecting every single pixel and applying a random color seems like something that would take a script hours...
Why do I need this?
I've started creating some filters in Pixel Bender (http://en.wikipedia.org/wiki/Adobe_Pixel_Bender). Since Pixel Bender doesn't really have any random generator (and workarounds are limited) I'm planning on passing on the random numbers through random pixel values. I'm well aware that this can only be used for filters in which Pixel Bender creates images from scratch, but that's the plan.
Thanks!

Understanding the details of the Add Noise filter is probably beyond the scope of just a short post.  Here is an approach to start learning what it does.
- Take a 50% gray level and make it a Smart Object.
-  Open up the historgram panel (should show a spike right at 50%)
- Apply noise filter to Smart Object in monochrome building up from small percentages in small increments
- You will notice that for this option above, you end up with a uniform probability function over the entire tonality spread at 50% applied for uniform distribution.
There are a variety of ways to manipulate this function, through various blends.
Please note a couple things
1) I am using CS5 and though not documented anywhere that I have seen, the Noise Filter does work different than in CS4.  In CS4, if you run the same noise filter twice on two identical objects, my experience is that you get the identical bit for bit result ( a random pattern yet not independent of the next run of the filter).  Manipulating Probability Density Functions (PDFs) per my previous post requires that each run of the Noise Filter starts with a different "seed" so that the result is independent of the previous run.  CS5 does this where succesive runs will create an independent noise result.
2) PS does not equally randomize R, G, and B.  There are ways to get around this yet wanted to give you a heads up.
3) There are other ways to generate quick random patterns outside of PS and bring them in (using scripts).   You would need to understand the format of the Photoshop Raw file.  This type of file contains bytes with just the image pixel data.  These types of files are easy to create and then load into PS. From a script (or even faster call a Python script) create this file and then load it into PS as a Photoshop Raw format file and use as an overlay.  There is not question that this is faster than trying to manipulate individual PS pixesl through a script.
4) Please not the under Color Settings there is an option called Dither.  If this is set, there are  times where PS adds nosie into the image (I leave mine turned off).  If is used in a number of places in PS other than what the documentation implies (more than just when moving between 8 bit color spaces)
Good luck if you are going after making a plug-in.  I have never invested in that learning curve.  Good luck.

Similar Messages

  • How to create a new user in IDM 8.1 with random generated password?

    Hi, i want create a new user using a modified tabbed user fom that cannot ask for password and confirm password to the administrator but randomly generate a new password (only when the form is opened in user creation) according to password policy and display it on the form.
    I think it is possible because Reset User Password Form does it, but i don't know how put this kind og logic in an other form.
    thanks
    Marco

    If you want to generate a users password randomly then you could take a look at the com.waveset.provision.PasswordGenerator class inside the Identity Mgr REF kit. Here's an example:
    <Rule name='generateRandomPassword'>
           <Comments>generate a random password</Comments>
           <RuleArgument name='accountId' value='Configurator'>
             <Comments>accountId of the user</Comments>
             <String>Configurator</String>
           </RuleArgument>
           <RunAsUser>
             <ObjectRef type='User' id='#ID#Configurator' name='Configurator'/>
           </RunAsUser>
           <block trace='true'>
             <defvar name='session'>
               <or>
                 <ref>context</ref>
                 <ref>display.session</ref>
               </or>
             </defvar>
             <defvar name='wsuser'>
               <invoke name='getObject' class='com.waveset.ui.FormUtil'>
                 <ref>session</ref>
                 <s>User</s>
                 <ref>accountId</ref>
               </invoke>
             </defvar>
              <defvar name='pwgenerator'>
               <new class='com.waveset.provision.PasswordGenerator'>
                 <ref>session</ref>
               </new>
             </defvar>
             <invoke name='generatePassword'>
               <ref>pwgenerator</ref>
               <ref>wsuser</ref>
             </invoke>
           </block>
        </Rule> You'll want to take the password.password field and inside the Default event handler check to see if waveset.id is null, if it is then call the Rule above.
    HTH,
    Paul

  • Identity Sync - Password randomly generated in AD

    Configuration:
    DS 5.2 Patch 2
    on Solaris 9
    with Identity Sync for Windows 1 2004Q3
    configured to Synch from DS to AD
    I have set up object creation to flow from DS to AD, and the user creation works okay but the password I create the account with is not being pushed to AD. Instead it creates the account with a randomly generated password. Is there a way around this, I am attempting to script new user creations. Here is log entry I get in error.log when I create a user.
    [08/Mar/2005:11:35:59.416 +1000] WARNING 29 CNN101 tyr "Successfully created user cn=James Test,cn=users,dc=xxx,dc=xxx,dc=xx with randomly generated password. This account will be unusable until another password is set." (Action ID=CNN100-1027FA4BBD3-491, SN=2)
    Thankyou in advance for any assistance!!
    regards
    Gryph

    I've been doing some more testing and have some more information that might be important.
    I have been testing the attribute synchronisation for the mappings I have done, and noticed that if I modify the userpassword attribute in the DS console it is not being synch'd to AD, but I can modify other attributes and they do get synch'd. If I modify the password on the AD side it gets synch'd back to DS ok. I have attribute modification set to flow in both directions and the password mapping is (DS) userpassword <--> unicodepwd (AD).
    Given it seems to ignore changes to the userpassword attribute for modifications, it looks like this is also holding true for creations, and I guess this is why it's randomly assigning a password.
    Any ideas why it sees other attribute modifcations and synch's them from the DS side, but is not seeing the userpassword attribute?
    Regards
    Gryph

  • T510 Random Stuck Pixels?

    I received my T510 FHD Thinkpad about a month ago and over the last few days it started to display random stuck pixels (always on - white).  I say random because they eventually go away when I open and close windows or reboot the computer.  Mysteriously reappearing later at random (not in the same spots if I recall correctly)???
    After doing some internet research, I ran JScreenFix (http://www.jscreenfix.com/) for about an hour on full screen.  The problem persists.
    My son suggested this could be a driver issue (supported by the fact that the pixel becomes "unstuck" when shutting down Windows XP and doesn't appear until Windows finishes booting up).  I am using the most recent Nvidia drivers so I'm hoping this is not isolated.
    Any help/suggestions would be greatly appreciate.
    Thanks,
    Stephen

    Update
    This is apparently an issue exclusive to Windows XP.  I used a separate HD and installed Windows 7 - no temporarily stuck pixels.
    Have to assume this is a driver issue.  Hopefully, Lenovo/Nvidia will release a fix soon.
    Any other ideas/fixes would be appreciated.
    Thanks.

  • How to use the random generator in java

    hey peeps, this is the class in which i am trying to implement the random generator in;
    public class Matchlist
        private studentdetails sd = new studentdetails();
        /** matchList StringBuilder stores the match list in progress */
        private StringBuilder matchList = new StringBuilder();
        private int loop = 0;
        private int matches = 0;
        public Matchlist()
            sd.createstudentdetails();
        /** Method to create the actual match list, returns the list as a string */
        public String CreateMatch()
            int g;
            int y;
                for (g = 0; g < 4; g++)//g = game
                    for (y = 17; y > -1; y--)//y = green house
                        /** Check to see if the game is empty */
                        if (sd.getgh(y).getGame(g).equalsIgnoreCase(""))
                            for (int x = 0; x < 18; x++) //x = yellow house
                                if (sd.getyh(x).getGame(g).equalsIgnoreCase(""))
                                    if (sd.getgh(y).getC_lass() != sd.getyh(x).getC_lass())
                                        /** Check to see if the person has played the other person */
                                        if (sd.getgh(y).checkPlayed(sd.getyh(x).getName()) == false)
                                            /** Set the game to the name of the opponent played */
                                            sd.getyh(x).changeGame(g, sd.getgh(y).getName());
                                            sd.getgh(y).changeGame(g, sd.getyh(x).getName());
                                            /** Build the match list step by step using append with \n at the end to create a new line */
                                            matchList.append(sd.getyh(x).getName() + " vs " + sd.getgh(y).getName() + "\n");
                                            matches++;
                                            break;
                /** Convert the stringbuilder into an actual string, then return it */
                String completeMatchList = matchList.toString();
                System.out.println(matches);
                for (int i = 0; i <18; i++)
                    sd.getyh(i).getEmptyMatches();
                    sd.getgh(i).getEmptyMatches();
                return completeMatchList;
        }what i dont understand is how to implement it to pick my matches at random using the http://java.sun.com/j2se/1.4.2/docs/api/java/util/Random.html java tutorials from here
    regards

    How to use Random ?
    First you open API then you read it, then you use it.
    You mention you try to use it but i just see a horrible nested for for for if if if loop.
    Restructure code and question and maybe it makes more sense.
    Edited by: pgeuens on 10-mrt-2008 22:58

  • How to make a random generator with a max and a minimum

    hello
    can anybody telle me how to make a random generator for numbers with a maximum and minimum input
    thanks in advance

    Hi suske,
    If you want a random day for a given month, this is how I would do it.
    Hope this helps,
    -D
    Message Edited by Darren on 02-02-2006 01:35 PM
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    Days_per_month.jpg ‏32 KB

  • Writing a class using random generator in bluej

    Hello
    Im trying to write a class for a deck of cards. Im using a random generator but I dont know how to write the instance variable.
    I have to make 4 suits heart, club, spade, dimonds. and 13 for face value. I know how to random generate numbers. Like if I were making a slot machine to give me 3 numbers in a rage from 0-10. Thats just numbers. How do I random generate values of 1-13 and have it output a random suit? Also how do I make it say if its a jack king or queen? Do I need a constructor or how would I make the card with the face value of 13 suit heart and the card be a queen.
    before jumping down my throat about this being a homework assignment...yes it is but this step Im seeking help on there is no example for this type of generating.
    Thanks for any help
    Rewind

    Well, this is far from bullet-proof, but I think gets the basic idea across. This does sampling with replacement; if you wanted to do something like shuffle a deck of cards you'll need a smarter approach than this.
    import java.util.*;
    public class RandomCards {
      public static void main(String[] args) {
        Suit suit=new Suit();
        for (int i=0; i < 10; i++) {
          System.out.println(suit.nextSuit());
      private static class Suit {
        public static final String HEART="Heart";
        public static final String DIAMOND="Diamond";
        public static final String SPADE="Spade";
        public static final String CLUB="Club";
        private final String[] SUITS={ HEART, DIAMOND, SPADE, CLUB };
        private Gen suitGen=new Gen(0,3);
        public String nextSuit() {
          return SUITS[suitGen.nextInt()];
      private static class Gen {
        private int floor,ceiling;
        private Random rand;
        public Gen(int floor, int ceiling) {
          this.floor=floor;
          this.ceiling=ceiling;
          rand=new Random();
        public int nextInt() {
          return rand.nextInt(ceiling-floor)+floor;

  • Just updated to 6.0 and I'm noticing random white pixels on black images.

    Just updated to 6.0 and I'm noticing random white pixels on black images. It's not my monitor since this doesn't happen to any other browsers. It might also be a plugin.

    Clear Cookies & Cache
    * https://support.mozilla.com/en-US/kb/Template:clearCookiesCache
    Clear the Network Cache
    * https://support.mozilla.com/en-US/kb/How%20to%20clear%20the%20cache#w_clear-the-cache
    Troubleshooting extensions and themes
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes
    Update All your Firefox Plugins
    * https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    * http://www.mozilla.com/en-US/plugincheck/
    Troubleshooting plugins
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins
    Check and tell if its working.

  • Random generated number along with barcode in smartforms

    Hi All,
    Is it possible to add some random generated number by system to add along with the end of the barcode in smartforms. (what could be the field) If so how it can be done. Tanks in advance
    Regards
    GK

    Hi Tankx man 4 the valuable reply,
         I am able to get that, but what my problem is,
    Eg: In my GR a item with 10 qty, so i made the qty as input and based upon that i am printing 10 labels. for ur ref the code is below"
    menge = TRUNC( is_mseg-menge ).
    DO menge TIMES.
    header-slno = header-slno + 1.
    APPEND header TO itab.
    the complete program is like as follows;
    menge = TRUNC( is_mseg-menge ).
    DO menge TIMES.
    header-slno = header-slno + 1.
    APPEND header TO itab.
    CALL FUNCTION 'QF05_RANDOM_INTEGER'
    EXPORTING
    RAN_INT_MAX   = '999999999'
    RAN_INT_MIN   = '100000000'
    IMPORTING
    RAN_INT       = RANINT
    EXCEPTIONS
    INVALID_INPUT = 1
    OTHERS        = 2.
    IF SY-SUBRC EQ 0.
    ENDIF.
    WRITE :/ RANINT.
    ENDDO.
    but in my barcode all the label has the same random number, can u say how to solve this.

  • SPro | SQR APY1060 is randomly generating Corrupted PDF's

    Hi,
    We're in the process of implementing SPro FSCM 8.9 on 8.47.11 for one of our clients. While the running the OOB SQR APY1060, we've found that the SQR randomly generates corrupted PDF. When we run the Process again, it works fine...Its is also difficult to replicate in other environments.
    Has any body faced an issues like this earlier with any PS delivered SQR.
    We've been able to zero in on the culprit - Control-M ... We've noticed a pattern, using the same run control ID, if we run it (PSJob) using the online page, then the PSJob runs absolutely fine. However, when we schedule it through Control-M the corruption happens. Also, if we create separate Process Requests in Control-M to schedule individual processes rather than the OOB PSJob, the SQR runs fine...Not sure if some one has come across such an issue...
    Thank You
    Prashant
    Edited by: PSFT_PP on Feb 9, 2009 8:47 AM

    I am not sure about this..but do you have different run control for the different OS or the same run control. Unix always recognises CAPS runcontrol values. do a check on that please.

  • Randomly generate an ID for SQL Create Table command

    Hi,
    I need help to randomly generate an integer, which i can use as a primary key for the ID of a table field. I have no idea how to do this so that it generates a different number every single time.
    Right now it just increments the ID by 1. Maybe, is there a way to get the last ID value of the table field and then increment starting from that one? thanks

    Your analysis is flawed! One of my main reasons for
    doing this is to reduce the load on the db server. I
    don't have to go to the db to get an id every time I
    need one. Every now and again (usually less than one
    in a 2000) I have to repeat an insert operation.
    You already stated that this was the reason, so I used that as part of my assessment. With most, perhaps all databases, the ability to increment a key is done as part of the insert operation. It requires no additional 'trip' to the database to get the ID. There is so much wrong with your idea, I hardly know where to start. I wouldn't be so firm except you stated that you do this all the time. Even using it once is very questionable I wouldn't want this idea to profilerate to other peoples systems without comment.
    You also said:
    On one project I was having to place usage transaction records
    into a database with each one needing an ID. I started using your
    technique but it was taking almost as much time as the insert of
    each transaction into the database.I agree, and I think dcminter agreed that there are less expensive practices then max(fld)+1 which are in fact using the vendor specific capabilities. However, if this was taking as long as your insert, there was probably something else wrong. For example, if the field you are getting the max value for isn't indexed, or isn't the first field in a contatenated index (an index of multiple fields), then some databases (there are exceptions like redbrick) will require either a full table scan, an index scan or an ackward index lookup to give back the max value. It shouldn't be that way, but it is and you have undestand how your database is resolving max() in order to make the best decisions.
    I stand by analysis and I would suggest that rather then use your method "all the time" that you save it for that unusual situation where nothing else will work for you.

  • QCPatch 'Random Generator' Broken Seed?

    Hi there all,
    Just putting this out there - perhaps I'm wrong, but want some other QC developers who are more experienced to compare with.
    Quartz Composer Patch "Random Generator" - one of the inbuilt patches available.
    Its purpose is to generate random numbers between a range, and supply the number on its output port.
    To this end, it works fine.
    My problem with this patches behavior occurs when it is nested in a macro patch, and that patch is then duplicated (purpose obvious).
    *The duplicated macro patch appears to also copy the Random Generators' base seed.*
    For example I have the same picture resulting from Random Generators nested inside a macro patch that contains processing for a random choice of image to a sprite.
    The only way i could work around this (and this may help others with the same problem) was to Publish the Input ports all the way up to the root level patch, and supply new instances of a Random Generator for each instance of the duplicated macro patch.
    Then I received fresh random seeds from the generator and different images were selected for output to my nested sprite.
    Awfully inconvenient given that each macro had 4 levels of nesting using objects like render in image, 3D transformation and Lighting - all patches that require nesting, and also reset your ports being passed to a parent, meaning you have to - 're-map' the Published Inputs with every layer of nesting. Not to mention the fact that the root level of the document is cluttered all to **** with millions of Random Generator patches.
    Anyone get this behavior?
    Please let me know if I'm just screwing my design up, or if this is encountered by you too and we should report it as a bug. (Ive only been devving QC for several weeks straight, so I'm want to actually report it as a bug yet).
    Many thanks in advance,
    Wilks.

    A random created with the same seed will give the same set of random numbers.
    Take out the Random creation from the loop
    try
                 BufferedWriter out = new BufferedWriter(new FileWriter("c:/test.txt"));
                    //Create Random here.
                     Random r = new Random( );//No need for any seed
                 for (int i = 0; i < 1000; i++)
                      out.write(String.valueOf(r.nextInt(9)));
                 out.close();
    catch (IOException e)
    [url http://www.feedfeeds.com/feedtv]Feed Your Feeds

  • RANDOM 'DEAD' PIXELS CONSTANTLY CHANGING ... ?

    I first noticed this on starting up my new iMac from the box ...... I thought I had 'hundreds' on random dead pixels .......
    It disappeared, so I thought it was jusr 'the screen warming up'
    Since then it happens randomly .. some times the pixels move, like when I take a screen shot of them ... I can also take a screen shot of a plain blue screen and as I draw a box to take the screen shot, the random black pixels appear, even though there was non actually there beforehand .....
    Often they appear on 'wake from sleep', sometimes like this morning on booting from cold .. but ONLY on new 'white' Mail windows, not the plain blue background of the Mac ..
    I guess it must be a video issue ?

    Sounds like a hardware issue to me. Since it had this problem right out of the box, you should contact Apple ASAP for service or replacement. (The latter will only be an option, I would bet, if you bought it recently, not if you've been sitting on this problem for a while.)

  • Implementing the random generator

    Hello, i have posrted this question in the forum yesterday, and didnt get a reply, so i am reposting, hope i havent violated any of the forum rules? If i have can a mod tell me, delete it and ill try and find my old post
    The problem i am having is trying to implement thwe random generator in to my code, it hasnt been done correctly as its not printing out a list of matches based on the conditons, can someone tell me what is wrong? thanks
    import java.util.Random;
    public class Matchlist
        private studentdetails sd = new studentdetails();
        /** matchList StringBuilder stores the match list in progress */
        private StringBuilder matchList = new StringBuilder();
        private Random studentPicker = new Random();
        private int loop = 0;
        private int matches = 0;
        public Matchlist()
            sd.createstudentdetails();
        /** Method to create the actual match list, returns the list as a string */
        public String CreateMatch()
            int game;
            int yellowStudent = 0;
            int currentGame = 0;
            int matchAttempt = 0;
            while (matches < 70)
                makeMatches:
                for (game = 0; game < 4; game++)//g = game
                    for (int greenStudent = 0; greenStudent < 17; greenStudent++)
                        while (sd.getgh(greenStudent).getGame(game).equalsIgnoreCase(""))
                            matchAttempt++;
                            if (matchAttempt > 800)
                                sd = new studentdetails();
                                game = 0;
                                matches = 0;
                                break makeMatches;
                            yellowStudent = studentPicker.nextInt(17);
                            if (sd.getyh(yellowStudent).getGame(game).equalsIgnoreCase(""))
                                if (sd.getgh(greenStudent).getC_lass() != sd.getyh(yellowStudent).getC_lass())
                                    /** Check to see if the person has played the other person */
                                    if (sd.getgh(greenStudent).checkPlayed(sd.getyh(yellowStudent).getName()) == false)
                                        /** Set the game to the name of the opponent played */
                                        sd.getyh(yellowStudent).changeGame(game, sd.getgh(greenStudent).getName());
                                        sd.getgh(greenStudent).changeGame(game, sd.getyh(yellowStudent).getName());
                                        /** Build the match list step by step using append with \n at the end to create a new line */
                                        matchList.append(sd.getyh(yellowStudent).getName() + " vs " + sd.getgh(greenStudent).getName() + "\n");
                                        matches++;
                                        currentGame++;
                                        if (currentGame == 18)
                                            currentGame = 0;
                                            break;
            /** Convert the stringbuilder into an actual string, then return it */
            String completeMatchList = matchList.toString();
            System.out.println(matches);
            for (int i = 0; i < 18; i++)
                sd.getyh(i).getEmptyMatches();
                sd.getgh(i).getEmptyMatches();
            return completeMatchList;
        }

    Where is it occuring? What are the values of the variabels at that point? We can't even run your code to find out because it could be in the studentdetails class which you haven't posted. I suggest you use an IDE to set breakpoints and step through it in a debugger which will allow you to examine the state of the program a any given point and identify where the NPE is coming from.
    For Netbeans
    http://www.netbeans.org/kb/55/using-netbeans/debug.html
    For Eclipse
    http://pages.cs.wisc.edu/~cs302/resources/EclipseDebugTutorial/

  • Labview random generator leds

    Hey Labview users,
    I'm a novice with labview and i have to solve the next exercise. Create a random generator 10 which generates random numbers between 0 and 100.
    Provide between 2 numbers generated a delay of 1s.
    Provide also 3 LEDs that light up as follows:
    - Red LED: 70 <random number
    - Green LED: 30 <random number <70
    - Orange LED: random number <30
    Only when the 10 random numbers are generated, enter this  1 dimensional, profiled collection (1D array).
    Can anybody show me the block diagram
    Can somebody help me please ? It's quite urgent.(i have untill saterday 26/1)
    Any solution is welcome !

    Well, if you have to have this done, you hade better get on with it.
    A couple hints:
    The random number generator built into LV puts out a DBL float value between 0 and 1.
    You can use the threshold function to determine which of the three LEDs should be on.
    You know ahead of time that the VI needs to loop 10 times, so you can use a for loop.
    There is a wait function in LV that you can use to generate the 1 sec delay.
    Beyond this, we will not write your homework for you. We don't need your degree, we have degrees of our own.
    Post code and we will help you by answering specific questions.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Getting the following error while creating a new configuration

    Hi team, I am trying to create configuration of my web dynpro application. When I right click on my application and choose create/change configuration, browser started. Now when I give a name ( e.g zabc) to it and choose the function create, the foll

  • Accounting document missing for MIGO

    A migo document doesnu2019t have corresponding FI document. While selecting FI document option it says No subsequent document found in Accounting Message no. RW011 Diagnosis All documents generated in Financial Accounting for object type 'MKPF', Refe

  • CS5 Production Premium - Student. Upgrade to CS5.5?

    Thanks for reading all of this: I recently purchased CS5 Production Premium Student Edition. Adobe sent me an email saying I'm eligible for a complimentary upgrade. I sent in the request, and another email then said "When CS5.5 is available, we will

  • To check weather JAVAVM being used or not?

    Hi, We are in the process of cleaning up unnecessary components. As a part of this, first of all we are checking weather JAVAVM is being used or not?  How to confirm weather JAVAVM is being used or not? I gone through Database Feature Usage but could

  • NWDS doesn't display "Window Preferences" Options

    Hi Experts, I used to work in Netweaver Developer Studio (NWDS) without any problem, but now when I open "Window >> Preferences" Options, it doesn't display anything. It shows no options on the left side (white navigation panel) and no options on the