31 Replies Latest reply on Aug 26, 2010 10:43 AM by unique_screenname_here

    IDE Errors

    Royi A Level 1

      Hello.

      I encountered few erros messages and problems I could't figure out.

       

      Let's start with this message:

       

      ERROR: (line 0): AIF Internal exception

       

      There's nothing wrong in the first line (It comes built in).

       

      I'm trying to have a graph with 2 nodes.

      I got this message after adding a new node.

       

      The kernel does nothing (The same one you get when you start a new graph).

       

      Any advise?

       

      Another issue I have:

      WARNING: (line 45): Dependent: Radius is not initialized before use

      The Parameter Radius is Dependant (And evaluated in "evaluateDependents").

      Yet it's needed in the region functions (needed(), changed()).

      What's the order of calculation?

      Is that a violation?

       

       

      Thanks.

       

      P.S.

      There's a bug in Graph Mode.

      I guess there's a mix between XML and the PB language.

      When I try to mark a remark by // it gets the color of a remark yet the compiler stills use it.

        • 1. Re: IDE Errors
          Kevin Goldsmith Level 3

          you are getting this error with one of the sample graphs? which one? If not, can you post the code? The error you are seeing isn't tied to a particular line, but is from a larger issue. I need the graph to give you better info.

           

          Yeah, the code coloring in graphs doesn't work too well because we mix XML and Pixel Bender together. It will be fixed in a later update.

           

          EvaluateDependents runs before the region reasoning. The warning you saw might be a bug. Again, can you post your graph?

          • 2. Re: IDE Errors
            Royi A Level 1

            Here's the code:

             

            <?xml version="1.0" encoding="utf-8"?>
            <graph name = "IdentityGraph" xmlns="http://ns.adobe.com/PixelBenderGraph/1.0">
                <metadata name = "namespace" value =  "Your Namespace"/>
                <metadata name = "vendor" value = "Your Vendor" />
                <metadata name = "version" type = "int" value = "1" />
            
                <!-- Graph parameters -->
                <parameter type = "float" name = "BlurLayerRadius" >
                <metadata name = "defaultValue" type = "float" value = "2.0"/>
                <metadata name = "maxValue" type = "float" value = "5.0" />
                <metadata name = "minValue" type = "float" value = "1.0" />
                </parameter>
                
                <parameter type = "float" name = "DetailsLayerRadius" >
                <metadata name = "defaultValue" type = "float" value = "2.0"/>
                <metadata name = "maxValue" type = "float" value = "5.0" />
                <metadata name = "minValue" type = "float" value = "1.0" />
                </parameter>
                
                <!-- Image inputs and outputs of the graph -->
                <inputImage type = "image4" name = "src" />
                <outputImage type = "image4" name = "dst" />
             
                 <!-- Embedded kernel -->
                 <kernel>
                  <![CDATA[ 
                     <languageVersion : 1.0;>
                     kernel GaussianBlur 
                     <   
                        namespace:"Gaussian Blur";
                        vendor:"Royi";
                        version:1;
                     >
                     {
                        input image4 src;
                        output pixel4 dst;
                        
                        parameter float Std;
                        
                        dependent int Radius;
                        dependent float ssq, C;
                        
                        region needed(region outputRegion, imageRef inputIndex){
                            region result = outputRegion;
                            result = outset(result, float2(float(2 * Radius), float(2 * Radius)));
                            return result;
                        }
                        
                        region changed(region inputRegion, imageRef inputIndex){
                            region result = inputRegion;
                            result = outset(result, float2(float(2 * 15), float(2 * 15)));
                            return intersect(result, dod(inputIndex));;
                        }
                        
                        void
                        evaluateDependents(){
                            Radius = int(ceil(3.0 * Std));
                            ssq = Std * Std;
                            C = ((1.0) / (2.0 * ssq * 3.1415926535));
                        }
            
                        void evaluatePixel()
                        {
                            float4 Temp = float4(0.0);
                            for (int i = -Radius; i <= Radius; i++){
                                for (int j = -Radius; j <= Radius; j++){
                                    float ii = float(i) * float(i);
                                    float jj = float(j) * float(j);
                                    float2 currCoord = outCoord() + float2(float(i), float(j));
                                    Temp += sampleNearest(src, currCoord) * C * (exp(-((ii + jj)) / (2.0 * ssq)));
                                }
                            }
                            dst.a = 1.0;
                            dst.rgb = Temp.rgb;
                        }
                     }
                  ]]>
                 </kernel>
                 
                 <!-- Embedded kernel -->
                 <kernel>
                  <![CDATA[ 
                     <languageVersion : 1.0;>
                     kernel HP2 
                     <   
                        namespace:"High Pass";
                        vendor:"Royi";
                        version:1;
                     >
                     {
                        input image4 src;
                        output pixel4 dst;
                        
                        parameter float Std;
            
                        void evaluatePixel()
                        {
                            dst = Std * sampleNearest(src, outCoord());
                        }
                     }
                  ]]>
                 </kernel>
            
                <!-- Instances of the nodes -->
                <node
                    id = "BlurLayer1"
                    name = "GaussianBlur"
                    namespace = "Gaussian Blur"
                    vendor = "Royi" version ="1" >
                    
                    <evaluateParameters>
                    <![CDATA[
                        void evaluateParameters(){
                            BlurLayer1::Std = BlurLayerRadius;
                        }
                        ]]>
                    </evaluateParameters>
                </node>
                
                <node
                    id = "DetailsLayer"
                    name = "HP2"
                    namespace = "High Pass"
                    vendor = "Royi" version ="1" >
                    
                    <evaluateParameters>
                    <![CDATA[
                        void evaluateParameters(){
                            DetailsLayer::Std = DetailsLayerRadius;
                        }
                        ]]>
                    </evaluateParameters>
                </node>
            
                <!-- Connect the graph -->
                <connect fromImage = "src" toNode = "BlurLayer1" toInput = "src" />
                <connect fromNode = "BlurLayer1" fromOutput = "dst" toImage = "dst" />
                <connect fromImage = "src" toNode = "DetailsLayer" toInput = "src" />
                <!--<connect fromNode = "DetailsLayer" fromOutput = "dst" toImage = "dst" />-->
            
            </graph>
            

             

             

            I'm just playing with graphs.

            But when I try to have 2 of them it won't work.

             

            Moreover, the Gaussian Blur filter works really slow!

            I clipped it at radius (Standard Deviation - as you use in Photoshop) 5. For 10 it gets really slow.

             

            P.S.

            It's not just the coloring.

            The complier won't ignore //dddasasd ...

             

            P.P.S.

            Is it ok to use image3 with graphs?

            In kernels it seems to yield much better performances.

            • 3. Re: IDE Errors
              Royi A Level 1

              Ok, got a much simpler code which yields the same error:

              <?xml version="1.0" encoding="utf-8"?>
              <graph name = "IdentityGraph" xmlns="http://ns.adobe.com/PixelBenderGraph/1.0">
                  <metadata name = "namespace" value =  "Your Namespace"/>
                  <metadata name = "vendor" value = "Your Vendor" />
                  <metadata name = "version" type = "int" value = "1" />
              
                  <!-- Graph parameters -->
                  <parameter type = "float" name = "Factor1" >
                  <metadata name = "defaultValue" type = "float" value = "2.0"/>
                  <metadata name = "maxValue" type = "float" value = "5.0" />
                  <metadata name = "minValue" type = "float" value = "1.0" />
                  </parameter>
                  
                  <parameter type = "float" name = "Factor2" >
                  <metadata name = "defaultValue" type = "float" value = "2.0"/>
                  <metadata name = "maxValue" type = "float" value = "5.0" />
                  <metadata name = "minValue" type = "float" value = "1.0" />
                  </parameter>
                  
                  <!-- Image inputs and outputs of the graph -->
                  <inputImage type = "image4" name = "src" />
                  <outputImage type = "image4" name = "dst" />
               
                   <!-- Embedded kernel -->
                   <kernel>
                    <![CDATA[ 
                       <languageVersion : 1.0;>
                       kernel bgr 
                       <   
                          namespace:"bgr";
                          vendor:"Royi";
                          version:1;
                       >
                       {
                          input image4 src;
                          output float4 dst;
                          
                          parameter float Std;
              
                          void evaluatePixel()
                          {
                              dst.rgb = Std * sample(src, outCoord()).bgr;
                              dst.a = 1.0;
                          }
                       }
                    ]]>
                   </kernel>
                   
                   <!-- Embedded kernel -->
                   <kernel>
                    <![CDATA[ 
                       <languageVersion : 1.0;>
                       kernel grb 
                       <   
                          namespace:"grb";
                          vendor:"Royi";
                          version:1;
                       >
                       {
                          input image4 src;
                          output float4 dst;
                          
                          parameter float Std;
              
                          void evaluatePixel()
                          {
                              dst.rgb = Std * sample(src, outCoord()).grb;
                              dst.a = 1.0;
                          }
                       }
                    ]]>
                   </kernel>
              
                  <!-- Instances of the nodes -->
                  <node id = "bgr" name ="bgr" namespace = "bgr" vendor = "Royi" version ="1" >
                  <evaluateParameters>
                      <![CDATA[
                          void evaluateParameters(){
                              bgr::Std = Factor1;
                          }
                          ]]>
                  </evaluateParameters>
                  </node>
                  
                  <!-- Instances of the nodes -->
                  <node id = "grb" name ="grb" namespace = "grb" vendor = "Royi" version ="1" >
                  <evaluateParameters>
                      <![CDATA[
                          void evaluateParameters(){
                              grb::Std = Factor2;
                          }
                          ]]>
                  </evaluateParameters>
                  </node>
              
                  <!-- Connect the graph -->
                  <connect fromImage = "src" toNode = "bgr" toInput = "src" />
                  <!--<connect fromNode = "bgr" fromOutput = "dst" toImage = "dst" />-->
                  
                  <connect fromImage = "src" toNode = "grb" toInput = "src" />
                  <connect fromNode = "grb" fromOutput = "dst" toImage = "dst" />
              </graph>
              
               
              

               

              If I change the point where the "Remark" sign starts in the "Connect" section and put is on row above it works.

              It means if I clear a connection to one of the nodes all is good.

               

              Is there a chance that if you run a kernel on image an the route of that image won't lead to the output the complier gives an error?

              Let's say I add one more kernel which takes both results and average them, would that be ok?

               

              Thanks.

              • 4. Re: IDE Errors
                Kevin Goldsmith Level 3

                yes, the error is that the graph isn't fully connected.


                • 5. Re: IDE Errors
                  Kevin Goldsmith Level 3

                  we should be giving you a much better error here.


                  • 6. Re: IDE Errors
                    Royi A Level 1

                    Ok, It seems that if you create a node it must have a route to the output.

                    If it doesn't you get an error.

                     

                    Took the same code only added a simple "Averaging" kernel and voila - it works:

                     

                     

                    <?xml version="1.0" encoding="utf-8"?>
                    <graph name = "IdentityGraph" xmlns="http://ns.adobe.com/PixelBenderGraph/1.0">
                        <metadata name = "namespace" value =  "Your Namespace"/>
                        <metadata name = "vendor" value = "Your Vendor" />
                        <metadata name = "version" type = "int" value = "1" />
                    
                        <!-- Graph parameters -->
                        <parameter type = "float" name = "Factor1" >
                        <metadata name = "defaultValue" type = "float" value = "2.0"/>
                        <metadata name = "maxValue" type = "float" value = "5.0" />
                        <metadata name = "minValue" type = "float" value = "1.0" />
                        </parameter>
                        
                        <parameter type = "float" name = "Factor2" >
                        <metadata name = "defaultValue" type = "float" value = "2.0"/>
                        <metadata name = "maxValue" type = "float" value = "5.0" />
                        <metadata name = "minValue" type = "float" value = "1.0" />
                        </parameter>
                        
                        <!-- Image inputs and outputs of the graph -->
                        <inputImage type = "image4" name = "src" />
                        <outputImage type = "image4" name = "dst" />
                     
                         <!-- Embedded kernel -->
                         <kernel>
                          <![CDATA[ 
                             <languageVersion : 1.0;>
                             kernel bgr 
                             <   
                                namespace:"bgr";
                                vendor:"Royi";
                                version:1;
                             >
                             {
                                input image4 src;
                                output float4 dst;
                                
                                parameter float Std;
                    
                                void evaluatePixel()
                                {
                                    dst.rgb = Std * sampleNearest(src, outCoord()).bgr;
                                    dst.a = 1.0;
                                }
                             }
                          ]]>
                         </kernel>
                         
                         <!-- Embedded kernel -->
                         <kernel>
                          <![CDATA[ 
                             <languageVersion : 1.0;>
                             kernel grb 
                             <   
                                namespace:"grb";
                                vendor:"Royi";
                                version:1;
                             >
                             {
                                input image4 src;
                                output float4 dst;
                                
                                parameter float Std;
                    
                                void evaluatePixel()
                                {
                                    dst.rgb = Std * sampleNearest(src, outCoord()).grb;
                                    dst.a = 1.0;
                                }
                             }
                          ]]>
                         </kernel>
                         
                         <!-- Embedded kernel -->
                         <kernel>
                          <![CDATA[ 
                             <languageVersion : 1.0;>
                             kernel avg 
                             <   
                                namespace:"avg";
                                vendor:"Royi";
                                version:1;
                             >
                             {
                                input image4 src1;
                                input image4 src2;
                                output float4 dst;
                                
                                parameter float Std;
                    
                                void evaluatePixel()
                                {
                                    dst.rgb = ((0.5 * sampleNearest(src1, outCoord())) + (0.5 * sampleNearest(src2, outCoord()))).rgb;
                                    dst.a = 1.0;
                                }
                             }
                          ]]>
                         </kernel>
                    
                        <!-- Instances of the nodes -->
                        <node id = "bgr" name ="bgr" namespace = "bgr" vendor = "Royi" version ="1" >
                        <evaluateParameters>
                            <![CDATA[
                                void evaluateParameters(){
                                    bgr::Std = Factor1;
                                }
                                ]]>
                        </evaluateParameters>
                        </node>
                        
                        <node id = "grb" name ="grb" namespace = "grb" vendor = "Royi" version ="1" >
                        <evaluateParameters>
                            <![CDATA[
                                void evaluateParameters(){
                                    grb::Std = Factor2;
                                }
                                ]]>
                        </evaluateParameters>
                        </node>
                        
                        <node id = "avg" name ="avg" namespace = "avg" vendor = "Royi" version ="1" >
                        </node>
                    
                        <!-- Connect the graph -->
                        <connect fromImage = "src" toNode = "bgr" toInput = "src" />
                        <connect fromNode = "bgr" fromOutput = "dst" toNode = "avg" toInput = "src1" />
                        <connect fromImage = "src" toNode = "grb" toInput = "src" />
                        <connect fromNode = "grb" fromOutput = "dst" toNode = "avg" toInput = "src2" />
                        <connect fromNode = "avg" fromOutput = "dst" toImage = "dst" />
                    </graph>
                    
                     
                    

                     

                     

                     

                    I'll check it with the other code.

                    I think it's  a bug, because I want to write a complexed graph and it means I won't be able to find errors on the way by switching the output to only one of the routes.

                    It should give a warning in my opinion.

                     

                    Kevin, What do you think?

                    Thanks.

                    • 7. Re: IDE Errors
                      AIF Bob Level 3

                      Thank you for the graphs - they show up (at last) two bugs in the compiler. First of all, the "AIF Internal Exception" error isn't one that should ever appear - that shows that something's gone wrong inside the compiler.

                       

                      The warning about Radius not being initialized is also wrong - it's correctly initialized in evaluateDependents. I have discovered that moving evaluteDependents before the needed function fixes that warning though.

                       

                      I've filed a bug for this graph.

                       

                      As you've discovered, the workaround is to make the graph fully connected.

                      • 8. Re: IDE Errors
                        Royi A Level 1

                        Hello Bob.

                        Glad to be the first to find bugs.

                        Actually I think I have a code which works on the GPU yet crashes on the CPU.

                        If I didn't delete it I can send you guys.

                        Got an email address?

                         

                        I hope someday you'll be able to make the ideas about "pixel" come true.

                         

                        I really think Pixel Bender might become the perfect solution for people like me - Would like to try some Image Processing algorithms in Photoshop along the simplicity of "Prototyping" language yet demands solid performances.

                         

                        Could you advise me (Maybe even consider a whole chpater in the next release of documentation) about performances.

                         

                        What works well, What shouldn't I do etc...

                        It seems to be really slow with the Gaussian Blur Kernel for large Radius.

                         

                        Regarding regions, I don't think I got it all.

                        When I can be more specific I'll ask again.

                         

                        Now, got something almost ready.

                        It just to slow yet.

                        • 9. Re: IDE Errors
                          AIF Bob Level 3

                          If you post the filter that shows differences between CPU and GPU on here I'll see it and take a look.

                           

                          Performance is a big topic. One thing to remember is that if your underlying algorithm is O(radius), coding it up in Pixel Bender won't change that - the constant might be smaller but fundamentally it is still O(radius).

                           

                          Looking at the gaussian blur filter you have in your graph file, you might try moving the calculation of the weights into evaluateDependents and writing the results into a dependent float array. This will mean you need to set a maximum limit on your radius (because the array size must be known at compile time) bt it reduces the computation that needs to be done.

                           

                          Also, you have one kernel doing a 2D blur - since the gaussian blur is separable you can create 2 kernels, one for a horizontal blur, one for a vertical blur. This will take you from O(radius^2) to O(radius).

                          • 10. Re: IDE Errors
                            Royi A Level 1

                            Thank you.

                            I don't mean about the properties of the Gaussian.

                            I mean more about tthe properties of Pixel Bender.

                             

                            Using "needed()" improves performances?

                            Does loop holds an "Extra" penalty (Like in Matlab)?

                            Variables calculated in "evaluateDependants" are faster to calculate?

                             

                            You see my point.

                             

                            I have another question, Solving the "Beyond dod()" pixels in Convolution.

                            I saw that using "changed()" with the same with otuset(input, float2(Radius, Radius)) generates a black edge around the image.

                            The size of it is just the size of the needed pixels.

                            my question is if I can access those pixel in the kernel (Or in a Graph) somehow.

                            If I do I might be able to address that problem.

                             

                            Does graph would work fine if I set the img src and dst to pixel3?

                            Would that improve the performances?

                             

                            Thanks.

                            • 11. Re: IDE Errors
                              makc3d Level 1

                              AIF Bob wrote:

                               

                              If you post the filter that shows differences between CPU and GPU on here I'll see it and take a look.

                              http://twitter.com/makc3d/status/17530649252


                              http://twitter.com/makc3d/status/17531395121

                               

                              overall, I found that input declarations and sample calls must be in some kind of tight sync, or else filters simply do not work in flash. how come noone complains about it? sometimes it seems like i'm the only one who ever wrote a filter with more than one input.

                               

                              (sorry for hijacking the subject, it does in fact run same way in cpu/gpu modes, but not in flash)

                              • 12. Re: IDE Errors
                                AIF Bob Level 3

                                The region functions (needed, changed and generated) are useful for speed since they allow the system to work out exactly which pixels need to be computed and to compute no more than that. They're also required for correct results because they allow the system to work out which pixels need to be computed and to compute no fewer than that.

                                 

                                Loops are no worse than the alternative code you'd write that doesn't use loops. I know that sounds a bit tortured, but that's the accurate way of putting it. The big thing you're trying to avoid is different execution paths for different pixels - there are two typical ways that arises:

                                 

                                If statements where the condition depends on the position of the pixel (i.e. it might be different for adjacent pixels).

                                Loops where the loop upper bound depends on the position of the pixel.

                                 

                                When pixel bender is executed (whether on the CPU or the GPU), it is executed in a SIMD manner - it executes the same set of instructions across multiple pixels. Ifs and loops have the potential to break that. The runtimes will make sure that the results are correct, but there's a speed hit.

                                 

                                Ifs in general can be problematic. If possble, avoid ifs in your code. It's better to create two separate filters and decide at a higher level which one to run (because the deision is made once) than to switch between two options within a filter (because the decision then has to be taken at each pixel).

                                 

                                It's not that evaluateDependents is faster to calculate than evaluatePixel, but it is only calculated once per frame rather than once for each pixel. It's always worth trying to move computations from evaluatePixel to evaluateDependents.

                                 

                                As with almost all speed work though, you have to try the different options yourself in your particular circumstances to see which is faster.

                                 

                                I am not sure what's going on with the black edge around the image when you use changed - could you post example code and the exact procedure you follow to produce that effect.

                                 

                                You can set your input and putputs to pixel3. If you're not interested in the alpha channel that will work fine. It certainly shouldn't be any slower, it might or might not be faster (GPUs contain very specialized hardware for handling images - reducing the number of channels won't necessarily help).

                                • 13. Re: IDE Errors
                                  AIF Bob Level 3

                                  TrueOsama wrote:

                                   

                                  overall, I found that input declarations and sample calls must be in some kind of tight sync, or else filters simply do not work in flash. how come noone complains about it? sometimes it seems like i'm the only one who ever wrote a filter with more than one input

                                   

                                  Thank you for the example. I think the bug is purely in the toolkit (which is probably why there haven't been a flood of complaints about it) - can you tell me which version of the toolkit you have, and if it isn't the latest version (2.1) download the new version from here:

                                   

                                  http://www.adobe.com/devnet/pixelbender/

                                   

                                  and try it again.

                                  • 14. Re: IDE Errors
                                    Royi A Level 1

                                    AIF Bob wrote:

                                     

                                    Thank you for the example. I think the bug is purely in the toolkit (which is probably why there haven't been a flood of complaints about it) - can you tell me which version of the toolkit you have, and if it isn't the latest version (2.1) download the new version from here:

                                     

                                    http://www.adobe.com/devnet/pixelbender/

                                     

                                    and try it again.

                                    Thank for the detailed answer.

                                     

                                    Version 2.1?

                                    Though in the page it says 2.1 the filename is 2.0.

                                    When I install it (4 days ago) in the "About" window the written version is: 2.0.422584.

                                    There might some mistake.

                                     

                                    About the black area, I'll have a look and send it over.

                                    Do you have an email?

                                     

                                    Thanks.

                                    • 15. Re: IDE Errors
                                      Kevin Goldsmith Level 3

                                      Bob is ahead of himself. 2.1 will be released very soon.


                                      • 16. Re: IDE Errors
                                        Royi A Level 1

                                        Could we still infulence it?

                                        Is it only IDE upgrade or also for the Photoshop Plug In?

                                         

                                        We would really like to see better UI options - Checkboxes (Bollean Parameter, Radio Buttons).

                                        Moreover option for Binary Code - To hide the code (Just like your Oil Painter).

                                         

                                        Speaking of which, how did you hide it?

                                        • 17. Re: IDE Errors
                                          makc3d Level 1

                                          yep I'm on 2.0.422584... well, waiting for 2.1 then.

                                          • 18. Re: IDE Errors
                                            AIF Bob Level 3

                                            Royi A wrote:

                                             

                                            Version 2.1?

                                            Though in the page it says 2.1 the filename is 2.0.

                                            When I install it (4 days ago) in the "About" window the written version is: 2.0.422584.

                                            There might some mistake.

                                            The mistake is mine, and where the page says 2.1. The latest version of the toolkit is 2.0.

                                             

                                            Royi A wrote:

                                             

                                            About the black area, I'll have a look and send it over.

                                            Do you have an email?

                                             

                                             

                                            If you post it on here I'll see it. Alternatively I think the forum software will let you send me a personal message (although I'd rather keep it on the forum so that any useful information is here for other people to find).

                                            • 19. Re: IDE Errors
                                              Kevin Goldsmith Level 3

                                              Too late to make changes, but we definitely want to improve the UI in the plug-in. The Photoshop team is now really driving it, and they are much better at UI then we are, so hopefully it will look better in the next release.

                                               

                                              Working out some ideas on protecting Pixel Bender filters for 3rd party developers. I'll post to my blog: http://blogs.adobe.com/kevin.goldsmith/ when I have something to share.

                                               

                                              Can't talk about how we protected the Oil Paint filter.

                                               

                                                   Kevin

                                              • 20. Re: IDE Errors
                                                Royi A Level 1

                                                Could you tell the time frame for "The Next" release (GUI, Protecting Code)?

                                                Are we talking about Weeks, Months, Half a year, Year...

                                                 

                                                Just to know how to plane things.

                                                Thank you.

                                                • 21. Re: IDE Errors
                                                  Kevin Goldsmith Level 3

                                                  I can't actually talk about specific time ranges, and things may change depending on user requests, but think more like next version of Photoshop.

                                                  • 22. Re: IDE Errors
                                                    Royi A Level 1

                                                    Wow...

                                                    We won't be able to hide our codes till CS6 or so?

                                                    On average that's 1.5 years...

                                                     

                                                    Bad...

                                                    • 23. Re: IDE Errors
                                                      Royi A Level 1

                                                      AIF Bob wrote:

                                                       

                                                      I am not sure what's going on with the black edge around the image when you use changed - could you post example code and the exact procedure you follow to produce that effect.

                                                       

                                                      Ok, I could recreate it:

                                                       

                                                       

                                                      <languageVersion : 1.0;>
                                                      
                                                      kernel NewFilter
                                                      <   namespace : "Your Namespace";
                                                          vendor : "Your Vendor";
                                                          version : 1;
                                                          description : "your description";
                                                      >
                                                      {
                                                          input image3 src;
                                                          output pixel3 dst;
                                                          
                                                          parameter float Std
                                                          <
                                                              minValue: 0.0;
                                                              maxValue: 10.0;
                                                              defaultValue: 1.0;
                                                          >;
                                                          
                                                           dependent int Radius;
                                                          dependent float ssq, C;
                                                          
                                                          void
                                                          evaluateDependents(){
                                                              Radius = int(ceil(3.0 * Std));
                                                              ssq = Std * Std;
                                                              C = ((1.0) / (2.0 * ssq * 3.1415926535));
                                                          }
                                                          
                                                          region needed(region outputRegion, imageRef inputIndex){
                                                              region result = outputRegion;
                                                              result = outset(result, float2(float(Radius), float(Radius)));
                                                              return result;
                                                          }
                                                          
                                                          region changed(region inputRegion, imageRef inputIndex){
                                                              region result = inputRegion;
                                                              result = outset(result, float2(float(Radius), float(Radius)));
                                                              return result;
                                                          }
                                                      
                                                          void
                                                          evaluatePixel()
                                                          {
                                                              float3 Temp = float3(0.0);
                                                              for (int i = -Radius; i <= Radius; i++){
                                                                  for (int j = -Radius; j <= Radius; j++){
                                                                  float ii = float(i) * float(i);
                                                                  float jj = float(j) * float(j);
                                                                  float2 currCoord = outCoord() + float2(float(i), float(j));
                                                                  Temp += sampleNearest(src, currCoord) * C * (exp(-((ii + jj)) / (2.0 * ssq)));
                                                                  }
                                                              }
                                                              dst = Temp;
                                                          }
                                                      }
                                                      
                                                       
                                                      

                                                       

                                                       

                                                       

                                                      I usually intersect the "Changed" Region with dod().

                                                      If I got it right the changed() region should be the same as needed version in convolution.

                                                       

                                                      Anyhow, If I don't intersect it with dod() I get a black edge around the image (In the IDE).

                                                       

                                                      My question is simple, In a chain, May I forward an image with the black edge (Meaning its dod() will include this area).

                                                      If I could I might be able to overcome the unknown dimension of the image in Convolution.

                                                       

                                                      Thanks.

                                                       

                                                      P.S.

                                                      Kevin, How could contact the Phothsop Team which integrates Pixel Bender to give them some feedback.

                                                      Is there a way to make the Phothsop Plug In run PBJ's instead of PBK's?

                                                      Thanks.

                                                      • 24. Re: IDE Errors
                                                        AIF Bob Level 3

                                                        You're seeing the black edge because the toolkit uses the "changed" function to work out how much of the output image to display. Within Pixel Bender all images are infinite, but they're only defined over a certain area (everything outside that area is black), that's why intersecting changed with the DOD works.

                                                         

                                                        If you put this filter into a chain of filters, it will correctly supply whatever pixels the next filter in the chain asks for - ultimately whatever application is displaying the output will ask the final filter in the chain for a certain region and that information is propogated back through the graph and combined with the needed and changed functions for each filter to make sure the correct information is calculated.

                                                         

                                                        I believe that your needed and changed functions are correct.

                                                        I think the toolkit is doing the right thing (according to its definition of "right").

                                                         

                                                        Royi A wrote:

                                                         

                                                        My question is simple, In a chain, May I forward an image with the black edge (Meaning its dod() will include this area).

                                                        If I could I might be able to overcome the unknown dimension of the image in Convolution.

                                                         

                                                         

                                                         

                                                        I don't think I understand the question. The system is never "forwarding" an image. You could sample various pixels on the image and try to detect the black that surrounds the image but I suspect that would be unreliable and inefficient.

                                                        • 25. Re: IDE Errors
                                                          Royi A Level 1

                                                          Hello Bob.

                                                          My question is simple, May I define a different dod() size as output for the next Node (In a Graph).

                                                           

                                                          Is there a way to transfer a Variable / Array between Nodes?

                                                           

                                                          How about creating something more flexible for calculations.
                                                          Let's say I need to maximize a function over the pixels or something.

                                                           

                                                          I think if you let us transfer Variables / Arrays and different sizes of dod() between Nodes that would be great.

                                                          To make it clear, Lets say the first Node got an 1024x1024 image.

                                                          To the second node I want to transfer only a quarter, defined by me (The most Up - Left 512x512 pixels).

                                                           

                                                          Another problem I'm having.

                                                          It's a filter which convolves 4 kernels (4 Sliders for Radius).

                                                          It crashes a lot under CS5 (Never on the IDE).

                                                          Which data could I transfer you to examine that but the code?

                                                           

                                                          This is the crash log (What Windows 7 gives):

                                                           

                                                          Problem signature:

                                                            Problem Event Name: APPCRASH

                                                            Application Name: Photoshop.exe

                                                            Application Version: 12.0.1.0

                                                            Application Timestamp: 4c255ce6

                                                            Fault Module Name: Pixel Bender.8bf

                                                            Fault Module Version: 12.0.0.0

                                                            Fault Module Timestamp: 4c0597c6

                                                            Exception Code: c0000005

                                                            Exception Offset: 00000000000c8e9e

                                                            OS Version: 6.1.7600.2.0.0.256.1

                                                            Locale ID: 1033

                                                            Additional Information 1: b724

                                                            Additional Information 2: b7243db4c03c24d8d211389cec1f4303

                                                            Additional Information 3: b9ce

                                                            Additional Information 4: b9ce672e2a77d0892e29bde615be9e69

                                                           

                                                          Thanks.

                                                           

                                                          P.S.

                                                          I tried to run Pixel Bender uding ExtendScript.

                                                          It always crashes. There might be a connection to my previous problem?

                                                           

                                                          This is the log:

                                                           

                                                           

                                                          Problem signature:

                                                            Problem Event Name: APPCRASH

                                                            Application Name: Photoshop.exe

                                                            Application Version: 12.0.1.0

                                                            Application Timestamp: 4c255ce6

                                                            Fault Module Name: Pixel Bender.8bf

                                                            Fault Module Version: 12.0.0.0

                                                            Fault Module Timestamp: 4c0597c6

                                                            Exception Code: c0000005

                                                            Exception Offset: 00000000001fc75d

                                                            OS Version: 6.1.7600.2.0.0.256.1

                                                            Locale ID: 1033

                                                            Additional Information 1: 357f

                                                            Additional Information 2: 357f71500dfedf51692229de7a798f5b

                                                            Additional Information 3: e9a5

                                                            Additional Information 4: e9a5d7f63faf1bb1a99e9a9cd105a181

                                                          • 26. Re: IDE Errors
                                                            AIF Bob Level 3

                                                            May I define a different dod() size as output for the next Node (In a Graph).

                                                             

                                                            No, once you are running in a graph you have no control over the dod. That will depend on the size of the input images you pass in, the size of the region that the output wants to display and the region functions defined on the various filters.

                                                            Is there a way to transfer a Variable / Array between Nodes


                                                            No there isn't - our array support is extremely limited, some of the hardware that we run on has poor support for arrays. You can use the evaluateParameters function in a graph to calculate different values for different nodes in the graph.

                                                             

                                                            To make it clear, Lets say the first Node got an 1024x1024 image.

                                                            To the second node I want to transfer only a quarter, defined by me (The most Up - Left 512x512 pixels).

                                                            If you know the coordinates of the area you want from the first node's output image you can program the second node so that it will know when it is trying to sample the input image outside of that region, and you can then do whatever is appropriate for you application.

                                                             

                                                            One important thing about Pixel bender is that as far as a Pixel Bender kernel is concerned all images are infinite. They have a region in which they are non-zero, but you can sample an image anywhere on the 2D plane. If you sample outside the defined region you'll get back transparent black (0, 0, 0, 0).

                                                            • 27. Re: IDE Errors
                                                              Royi A Level 1

                                                              The evaluateParameters won't help.

                                                              I wanted to calculate something on an image in one node and pass to another (Let's say you blur the image trying to find some constraints and want to pass the to the next Node).

                                                              My idea was simple. If I could define the size of the dod() I could use it as an auxiliary array.

                                                              I still can do this partially, yet if the input is 3000X3000 image that might be inefficient.

                                                               

                                                              I wish you fixed that in the next iteration.

                                                               

                                                              I found a bug in the IDE - When you use "bool" Parameter in a graph it won't be shown in the order (In Photoshop it works well).

                                                               

                                                               

                                                              What about the crashes I'm experiencing?

                                                              Thanks.

                                                              • 28. Re: IDE Errors
                                                                AIF Bob Level 3

                                                                Another problem I'm having.

                                                                It's a filter which convolves 4 kernels (4 Sliders for Radius).

                                                                It crashes a lot under CS5 (Never on the IDE).

                                                                Which data could I transfer you to examine that but the code?


                                                                I really need the code to be able to track down what's going on. I believe that the forum software will let you send it to me privately if you don't want to post it here.

                                                                 

                                                                Also, we are working on a new version of the Photoshop plugin that fixes several bugs and should be out soon.

                                                                • 29. Re: IDE Errors
                                                                  Royi A Level 1

                                                                  I hope you'll make the Plug In as stable as the IDE. Never had a crash on the IDE. Have them all the time in Photoshop CS5.

                                                                  Notice the Boolean Parameter bug I reported.

                                                                   

                                                                  What do you think about being able to create Auxiliary image with (up to) arbitrary size?

                                                                  That would be a replacement for arbitrary size Matrix.

                                                                   

                                                                  I really hope to see 2 features in the next release:

                                                                  1. Being able to hide my code.

                                                                  2. Getting the Image Size as a parameter.

                                                                   

                                                                  In the long run there are many.

                                                                   

                                                                  What about changing the Graph Connections on the fly (Let's say there's a Kernel which should be applied only if...)?

                                                                   

                                                                  Don't be afraid to drop support of "old" hardware. DX10 and above is ok in my opinion.

                                                                  • 30. Re: IDE Errors
                                                                    Royi A Level 1

                                                                    I found another bug in the CS5 Plugin (Windows 7 64 Bit).

                                                                    If I enter the parameters value using keyboard it crashes Photoshop.

                                                                    • 31. Re: IDE Errors
                                                                      unique_screenname_here Level 3

                                                                      Sounds like this problem, "On Windows, the Plug-in will crash when typing numbers into a parameter edit field. You can use the sliders to avoid the crash" reported here, <http://labs.adobe.com/technologies/pixelbenderplugin/#release_notes>. Thanks for the heads up, though.