5 Replies Latest reply on Jan 10, 2011 7:33 AM by qu1j0t3

    Export layers to JPG file




      I wants to export only a single layer as JPEG file in Automation plugin. I have gone through the the implementation in which every layers in the current document is exported as files. But i wants to export any particular layer. I had searched the API for this, but havent got a single may be i am very new to this.


      Please guide me with what steps should i follow to achieve this.


      Thanks a lot.

        • 1. Re: Export layers to JPG file
          ilvar Level 3

          You _may_ actually be able to do what you want by using ActionScript  without even going to the Automation plugin. I'd really explore this  possibility first, since to do your task in C++ you'll have to write  quite a substantial amount of code.

          If you have to go though  Automation, start with the Getter plugin from the SDK - it will provide  you with the information about the layers within a document. The rest  depends on how you'd like your plugin to work: if, for instance, you  want a GUI with a layer selection functionality, you probably will have  to write a bunch of functions that use the document descriptor to count  the layers, retrieve their properties and then display them to the user  with some third-party toolkit or native GUI API that will supply you  back with the selected layer's ID or index. You may also simplify your  task and always export the current layer, in which case you need no GUI /  layer enumeration etc

          I hope that provides you with enough info to start

          • 2. Re: Export layers to JPG file
            dearvivekkumar Level 1

            Thanks for your reply.


            I have started with the automation plugin, But  definitely i ll go through the Getter plugin.

            for now my current status is that i have got information about the layer counts, layers name, layerIndex, layers ID. but m stucked where i have to save this layers to files.

            • 3. Re: Export layers to JPG file
              qu1j0t3 Level 2

              You could modify my standalone utility psdparse to output JPEG layers instead of PNG. Should be less than 2 hours' work.



              • 4. Re: Export layers to JPG file
                dearvivekkumar Level 1

                @ qu1j0t3


                Would you please tell me the step for achieving this. How do i gets the layer and save it a an image file.

                • 5. Re: Export layers to JPG file
                  qu1j0t3 Level 2

                  See: http://telegraphics.com.au/svn/psdparse/trunk


                  Code for writing PNG is included. As I say, to modify to use libjpeg should be a matter of a couple of hours.