Skip to content
/ psd Public

A C++17 STL loader for files in Adobe's PSD format

License

Notifications You must be signed in to change notification settings

varnholt/psd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psd

A C++17 STL loader for files in Adobe's PSD format.

The format specification can be found here:
https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_pgfId-1036097

usage

#include "psd.h"

// ...

// create an instance of your PSD file
PSD psd;
psd.setColorFormat(PSD::ColorFormat::ABGR);
psd.load("my_test.psd");

// iterate through its layers
for (const auto& layer : psd.getLayers())
{
   // ignore layer groups
   if (layer.getSectionDivider() != PSD::Layer::SectionDivider::None)
   {
      continue;
   }

   // evaluate layer properties
   std::cout
      << "name:    " << layer.getName() << std::endl
      << "opacity: " << layer.getOpacity() << std::endl
      << "width:   " << layer.getWidth() << std::endl
      << "height:  " << layer.getHeight() << std::endl
      << "left:    " << layer.getLeft() << std::endl
      << "top:     " << layer.getTop() << std::endl;

   // do something with the raw layer data
   auto layerData = layer.getImage().getData().data();
}

About

A C++17 STL loader for files in Adobe's PSD format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published