Skip navigation
Currently Being Moderated

Export layers to JPG file

Jan 3, 2011 11:55 PM



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.

  • Currently Being Moderated
    Jan 4, 2011 3:07 AM   in reply to dvkkk

    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

    Mark as:
  • Currently Being Moderated
    Jan 4, 2011 3:20 AM   in reply to Ilya Varaev

    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.

    Mark as:
  • Currently Being Moderated
    Jan 4, 2011 9:58 AM   in reply to dvkkk

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


    Mark as:
  • Currently Being Moderated
    Jan 5, 2011 12:21 AM   in reply to qu1j0t3

    @ qu1j0t3


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

    Mark as:
  • Currently Being Moderated
    Jan 10, 2011 7:33 AM   in reply to dearvivekkumar



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

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points