{"id":15586,"date":"2008-10-22T23:35:52","date_gmt":"2008-10-22T23:35:52","guid":{"rendered":"http:\/\/blogs.adobe.com\/jnackdev\/2008\/10\/per-layer-metadata-comes-to-photoshop.html"},"modified":"2008-10-22T23:35:52","modified_gmt":"2008-10-22T23:35:52","slug":"per-layer_metadata_comes_to_photoshop","status":"publish","type":"post","link":"http:\/\/jnack.com\/blog\/2008\/10\/22\/per-layer_metadata_comes_to_photoshop\/","title":{"rendered":"Per-layer metadata comes to Photoshop"},"content":{"rendered":"<p style=\"margin-top: 0;margin-bottom: 0\">Fair warning: this is likely to be a pretty nerd-tastic blog entry, and it&#8217;s the kind of thing most people will never know or care about.&nbsp; Unless, that is, someone leverages it to do extremely cool, useful things.&nbsp; Right now it&#8217;s kind of a toss-up.<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">In summary, Photoshop&#8217;s scripting system can read and write parameters (keywords, descriptions, etc.) for each layer, meaning you can more richly tag layers with info&#8211;something that&#8217;s highly valuable when moving PSDs downstream into other apps.&nbsp; Adobe hasn&#8217;t yet leveraged this support to enable new features, but the support is in place for developers.&nbsp; Read on for the details. <\/p>\n<p><!--more--><br \/>\n<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">For many years Photoshop has supported metadata tagging on a per-document level.&nbsp; Via the File Info interface or the Metadata panel in Bridge, you can edit things like a document&#8217;s copyright info, caption, etc.&nbsp; Photoshop also automatically adds\/modifies certain info (e.g. preserving  camera parameters stored in EXIF data; generating and storing a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Guid\">global unique ID<\/a> for each file).&nbsp; All this info is applied to the whole document, not to the doc&#8217;s constituent pieces.<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">In Photoshop CS4, however, it&#8217;s possible to store metadata on a per-layer basis.&nbsp; The Photoshop scripting system (which can now be controlled by Flash panels) can read and write any text data (keywords, descriptions, etc.&#8211;anything you can think of) for each layer.&nbsp; Just like other properties that are stored for each layer (visibility, opacity, blending mode, etc.), per-layer metadata moves around with layers themselves.&nbsp; You could, for example, attach a description to a layer, duplicate the layer, and have the description duplicated as well. <\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">The feature came about partly in response to requests from our friends at Pixar.&nbsp; Layered PSD files get consumed by their rendering pipeline, and they asked for a way to be able to tell which <em>parts<\/em> of files had been edited, and when.&nbsp; Previously this was impossible: when Photoshop would save a file, it would update the modification date for the file as a whole.&nbsp; Now it also tracks timestamp info <em>for each layer<\/em>, meaning that if only 3 out of 50 layers in a file have changed, a downstream app can pull out and re-render just those 3 layers.<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">That&#8217;s all good (and automatic; no user participation required), but we thought it would be useful to make the system more general.<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">Fundamentally, Photoshop files get used in a huge variety of applications and workflows (print, Flash authoring, motion graphics, DVD authoring, you name it), yet the Photoshop interface has no idea about the details.&nbsp; Consequently there really hasn&#8217;t been a good way to capture workflow-specific intention inside Photoshop.&nbsp; For example, how would you use a PSD to communicate that a certain layer is supposed to become a particular kind of movie clip in Flash, or a button rollover state in Encore?<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">People end up <em>heavily<\/em> overloading the few tools they&#8217;ve got&#8211;layer names, layer visibility, and nesting layers into folders\/groups.&nbsp; Naming conventions work up to a point, but they&#8217;re clumsy and fragile.&nbsp; Wouldn&#8217;t it be better to have a panel that let you display &amp; set parameters easily?&nbsp; For example, a panel could contain checkboxes or radio buttons for the different rendering options that should be applied to layers.&nbsp; Instead of trying to type codes for those parameters into each layer name, why not select a bunch of layers, then flip the appropriate checkboxes?<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">Okay, as you&#8217;ve read this far, I&#8217;ll reward you with some visuals:<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<ul style=\"margin-top: 0;margin-bottom: 0\">\n<li><a href=\"http:\/\/www.jnack.com\/adobe\/photoshop\/cs4_screenshots\/per_layer_metadata_mockup.png\">This mockup<\/a> depicts a Photoshop panel that displays the contents of a layer and makes it possible to set resizing coordinates for use in Flash or Flex.&nbsp; Photoshop proper doesn&#8217;t have to know or care about what these parameters mean; it just has to let you specify a set of X\/Y coordinates.&nbsp; These coordinates can then be read downstream, when the file is consumed by Flash or Flex. <\/li>\n<li>One of our summer interns coded up a sample panel (<a href=\"http:\/\/www.jnack.com\/adobe\/photoshop\/cs4_screenshots\/per_layer_metadata.gif\">screenshot<\/a>) that can read and write descriptions and comments on each layer.&nbsp; The panel and its source code are part of the PS <a href=\"http:\/\/www.adobe.com\/devnet\/photoshop\/\">Panel Developer&#8217;s SDK<\/a>, but I&#8217;ve also uploaded it <a href=\"http:\/\/www.jnack.com\/adobe\/photoshop\/per_layer_metadata.zip\">here<\/a> for convenience.&nbsp; (Unzip the contents to your Adobe Photoshop CS4\/Plug-Ins\/Panels directory, then relaunch PS and look under Window-&gt;Extensions for the panel.) [<strong>Update<\/strong>: The CS4 version of the sample panel doesn&#8217;t work in CS5, so please <a href=\"http:\/\/www.adobe.com\/devnet\/photoshop.html\">check out the CS5 version of the SDK<\/a>. I&#8217;m told the updated version of the panel is in there.] <\/li>\n<\/ul>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">As noted above, the metadata written here sticks to a layer, just like any other layer parameter would.&nbsp; Duplicate the layer and you duplicate its metadata; delete the layer and the metadata leaves, too.<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">&nbsp;<\/p>\n<p style=\"margin-top: 0;margin-bottom: 0\">Besides the automatic storing of timestamps for each layer, nothing else in the app leverages per-layer metadata&#8211;yet.&nbsp; Hopefully it&#8217;s becoming clear, however, that this bit of support should open up a lot of doors for richer documents and smarter cross-app workflows. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fair warning: this is likely to be a pretty nerd-tastic blog entry, and it&#8217;s the kind of thing most people will never know or care about.&nbsp; Unless, that is, someone leverages it to do extremely cool, useful things.&nbsp; Right now it&#8217;s kind of a toss-up. &nbsp; In summary, Photoshop&#8217;s scripting system can read and write [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[],"_links":{"self":[{"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/posts\/15586"}],"collection":[{"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/comments?post=15586"}],"version-history":[{"count":0,"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/posts\/15586\/revisions"}],"wp:attachment":[{"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/media?parent=15586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/categories?post=15586"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jnack.com\/blog\/wp-json\/wp\/v2\/tags?post=15586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}