Click here to Skip to main content
15,848,726 members
Articles / Web Development / ASP.NET
Tip/Trick

Simple PSD Parser

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
13 Aug 2015CPOL2 min read 15.3K   615   2   3
Upload Photoshop PSD files, extract layer bitmaps, extract info into xml.

Introduction

This is tool that will give .NET developers opportunity to parse Photoshop PSD file into 3 xml files which will include images. shapes and texts and also get all layers images

Examples of PSD sections it can handle:

  • Individual layers, including extracting their bitmaps,
  • Global channels
  • Slices, Grid/Guides, Thumbnails
  • Vector graphics properties
  • Text layers 

To parse the psd file you just need to run the WebApp upload the psd file and click Submit

The psd file itself and xml files will be located in application directory in ~/psdUploads/ folder and the layers images will be located in ~/psdLayersOutput/ directory

Background

A year ago, I had a project that requires to parse photoshop layered psd file into 3 separate xml files (images info, text and text params, shapes and shapes params). I searched a lot in web find some tools even in ww.codeproject.com like this one http://www.codeproject.com/Articles/15905/Yet-Another-PSD-Parser  but none of them not met my requirements. some of them not supporting photoshop latest versions, some not parsing vector graphics so I've combined and modified these projects got this one. Hope this will be helpfull for users

Using the code

As the code is part of the Endogine project, and uses several of the its classes, Endogine.dll has to be available for referencing. The host app also uses Endogine.Editors.dll for the XML editor.

 

 

Points of Interest

The newer Photoshop SDKs, which include the file format specifications, are protected by a license agreement that compromises the usability of code produced by anyone who has signed it. That's why I've had to use reverse engineering for creating many parts of the code, and why it's taking so long to complete it.

If you want to contribute to the project, please understand that I won't accept code from anyone who has signed an Adobe SDK agreement. That could potentially mean trouble ahead, the day evil Adobe wants to shut down this subversive operation.

If the program fails to load a document, please add a note about it in the comments section below and keep the file around - if I have time, I'll ask you to send it to me for closer inspection. Note that I currently only have interest in documents created with Photoshop version 6 or later.

History

  • 2014-07-25 - First draft of the library.

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Armenia Armenia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionparent variable has no value Pin
DsonKing25-May-16 0:12
DsonKing25-May-16 0:12 
Questiona well-rounded PSD Parser Pin
Member 102747263-Oct-15 20:38
Member 102747263-Oct-15 20:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.