Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inochi2d/psd-d
Experimental PSD loader made for Inochi Creator
https://github.com/inochi2d/psd-d
Last synced: about 2 months ago
JSON representation
Experimental PSD loader made for Inochi Creator
- Host: GitHub
- URL: https://github.com/inochi2d/psd-d
- Owner: Inochi2D
- License: bsd-2-clause
- Created: 2021-06-09T16:03:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-23T21:35:31.000Z (over 1 year ago)
- Last Synced: 2024-04-21T17:24:40.074Z (9 months ago)
- Language: D
- Size: 103 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PSD-D
psd-d is a lose experimental port of psd_sdk to D to support basic extraction of layer info and layer data from photoshop files.
Some features are not supported (yet), but we'll add them over time.Only the PSD format is supported, there's currently no support for PSB.
# Parsing a document
To parse a PSD document, use `parseDocument` in `psd`.
```d
PSD document = parseDocument("myFile.psd");
```# Extracting layer data from layer
To extract layer data (textures) from a layer use `Layer.extractLayerImage()`
```d
PSD doc = parseDocument("myfile.psd");
foreach(layer; doc.layers) {
// Skip non-image layers
if (layer.type != LayerType.Any) continue;// Extract the layer image data.
// The output RGBA output is stored in Layer.data
layer.extractLayerImage();// write_image from imagefmt is used here to export the layer as a PNG
write_image(buildPath(outputFolder, layer.name~".png"), layer.width, layer.height, layer.data, 4);
}
```