Saving photoshop files without opening them first

Greetings,

I have a plugin that works with .psd files.a lot. I was wondering if you can somehow take the .psd files and convert them into another file type, for example pngs without opening them first in Photoshop. Right now the only way to convert the psd documents I found is through the doc.saveAs.png method. I checked the documentation already and maybe I am just blind but I can’t find it.

Any help is appreciated,
Thanks

If your PSD is saved in compatibility mode it has preview. 3rd party tools can read it and save it without reading everything in PSD.

hi @Jarda,
thank you for your answer, just as a newbie in this regard and looking for a similar solution.
can you please explain what this answer can help to write the UXP way to do this?

Thank you again for your time.

Cheers,
Oliver

Anyone can write their own binary parser for PSD. I think the preview would be in Image Data Section https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_pgfId-1054855 So you would read only this part, convert it into RGBA bitmap and then to PNG and then save it to file system.

But that is not really for beginners. You could probably find some CLI tool to that for you e.g. Imagick or something like that. ImageMagick – Command-line Tools: Magick

But then again… UXP by default is unable to pass arguments to CLI.

1 Like

Thank you for the quick reply! Yes, so far I am to new for this, but at least I can follow the discussion.