Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSD to PNG #10

Open
feliperohdee opened this issue Jun 11, 2018 · 3 comments
Open

PSD to PNG #10

feliperohdee opened this issue Jun 11, 2018 · 3 comments

Comments

@feliperohdee
Copy link

There is a way to export PSD to PNG?

@mdboom
Copy link
Owner

mdboom commented Sep 23, 2018

Nope. pytoshop doesn't handle any rendering down of layers into a single layer. (That would be a major undertaking -- I'm not opposed to having it, I just haven't needed it myself).

@MehdiBOUNACEUR
Copy link

Hi, this feature will be very nice. Indeed, when we want to convert the image with the command line "convert" from ImageMagick. The error message is "Improper header". Moreover the preview of a psd file handled by pytoshop is a black screen instead of the layers.

Pytoshop is very good and help me a lot. Thanks !

@sungeuns
Copy link

sungeuns commented Mar 22, 2019

You can simply export psd to png. (Only when ImageData info exist)

import numpy as np
import pytoshop
from PIL import Image

def psd_to_png(psd_path, png_path):
    with open(psd_path, "rb") as fd:
        psd_file = pytoshop.read(fd)
        image_data = psd_file.image_data
        image_array = image_data.channels
        image_array = np.transpose(image_array, (1, 2, 0))
        im = Image.fromarray(image_array)
        im.save(png_path)

psd_to_png("psd_file.psd", "test.png")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants