I need to read PSD
file into PHP
code and get group layers and X-Y positions.
How can i do it? I've heard of ImageMagick but never worked on it.
If you guys have some links to get started please provide it to me.
GIMP is a free, open source alternative to Photoshop. It can open PSD files and even preserves layer information. GIMP is the most powerful option on this list and will allow you to make other modifications to the file.
PSD files are the native file format of Adobe Photoshop. You've probably seen files with the . psd extension format, especially if you've been an Adobe Photoshop user. Most commonly used by designers and artists, Photoshop Documents are powerful tools for image data storage and creation.
It' called QuickLook (from the developer Paddy Xu) and works really well. Open a folder on Windows Explorer, select a file and press the Space bar. Just keep the original Explorer window selected (not the QuickLook preview window) and you can even use the arrow keys to navigate between the files. Enjoy!
You can use ImageMagick for this, using something like:
$im = new Imagick("image.psd");
foreach($im as $layer) {
// do something with each $layer
// example: save all layers to separate PNG files
$layer->writeImage("layer" . ++$i . ".png");
}
Also, you can look at this answer to a question similar to yours, and has some code examples for how to get x,y
positions of layers, for instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With