6 Replies Latest reply on Sep 4, 2016 8:58 AM by c.pfaffenbichler

    48 bit rgb or 96 bit rgb pixel manipulation javascript

    rechmbrs Level 1

      I have only found examples for manipulating 24 bit rgb or 32 bit rgba pixels within javascript but need to handle whatever is passed to the script.  Can canvas handle 48bit or 96 bit pixels?  If so, please refer me to examples.

       

      Thanks,

      RONC

        • 1. Re: 48 bit rgb or 96 bit rgb pixel manipulation javascript
          Chuck Uebele Adobe Community Professional & MVP

          As far as I know, Photoshop only handles up to 32 bit images. Where are you getting 48 or 96 bit images?

          • 2. Re: 48 bit rgb or 96 bit rgb pixel manipulation javascript
            rechmbrs Level 1

            3x16 or 3x32 bits per rgb pixel.   My camera creates 16 bits per color.   Something like HDR uses 3x32 bits per pixel - 32 bits per color.

             

            Examples show only 24 or 32 bits per pixel and 8 bits per color for rgb or rgba.

             

            RONC

            • 3. Re: 48 bit rgb or 96 bit rgb pixel manipulation javascript
              Jarda Bereza Level 4

              Photoshop support 32bit per channel.

              2016-09-04_120922.jpg

              2016-09-04_120742.jpg

               

              This is example how colorPicerker set up foreground color:

              var idsetd = charIDToTypeID( "setd" );
                  var desc22 = new ActionDescriptor();
                  var idnull = charIDToTypeID( "null" );
                      var ref3 = new ActionReference();
                      var idClr = charIDToTypeID( "Clr " );
                      var idFrgC = charIDToTypeID( "FrgC" );
                      ref3.putProperty( idClr, idFrgC );
                  desc22.putReference( idnull, ref3 );
                  var idT = charIDToTypeID( "T   " );
                      var desc23 = new ActionDescriptor();
                      var idRd = charIDToTypeID( "Rd  " );
                      desc23.putDouble( idRd, 143.985385 );
                      var idGrn = charIDToTypeID( "Grn " );
                      desc23.putDouble( idGrn, 57.030228 );
                      var idBl = charIDToTypeID( "Bl  " );
                      desc23.putDouble( idBl, 57.030228 );
                  var idRGBC = charIDToTypeID( "RGBC" );
                  desc22.putObject( idT, idRGBC, desc23 );
                  var idSrce = charIDToTypeID( "Srce" );
                  desc22.putString( idSrce, """photoshopPicker""" );
              executeAction( idsetd, desc22, DialogModes.NO );
              

               

              Anyway your posibilities in 32bit/channel are reduced. Not everything in Photoshop is designed to work in this mode.

              2016-09-04_121251.jpg

              • 4. Re: 48 bit rgb or 96 bit rgb pixel manipulation javascript
                rechmbrs Level 1

                Thanks so much for the response.

                 

                Part of my reason for asking about 32bit/color is because of the missing functionality.

                 

                So I should be able to manipulate individual pixels the same way as you showed.  Correct?  But I'm sure it will not be very efficient.

                 

                Can I use getImageData and putImageData functions?

                 

                RONC

                • 5. Re: 48 bit rgb or 96 bit rgb pixel manipulation javascript
                  Jarda Bereza Level 4

                  Can I use getImageData and putImageData functions?

                  I have no idea. This questionis is for someone else. Or you could just try it.

                   

                  Otherwise you can use almost everything what is not disabled when PS is in 32/channel mode.

                  • 6. Re: 48 bit rgb or 96 bit rgb pixel manipulation javascript
                    c.pfaffenbichler Level 9

                    I seldom work with 32bit images, but I have found no problems in Photoshop Scripts handling 16bit images.

                     

                    Part of my reason for asking about 32bit/color is because of the missing functionality.

                    If functionality you want to use in a Script is unavailable for some bit depth/s you can either include a check (for bit depth) and proceed accordingly or wrap the affected sections of code in try-clauses.