4
2
I've been working on a theoretically simple web service to convert PSD or AI files to jpeg, png or some web-compatible format.
I was able to successfully use ImageMagic's convert -flatten sample.ai sample-ai.jpg
command, but consistently getting "invalid header" for various attempts using PhotoShop PSDs. I'm assuming ImageMagick prefers it's own or GIMP-saved PSD files, though perhaps I'm missing something there.
Also tried installing NConvert, but had problems with glibc version on client's CentOS 5.8, which I'm not permitted to change.
In any case, GIMP seems to have good PSD support. More than enough to flatten an image and save it. They've also recently updated their PSD parser. I've seen a similar question but
- that's on windows,
- they didn't really answer anything for GIMP,
- neither convert nor mogrify works for me
mogrify: Improper image header 'Test1.psd'.
So, does anyone know how to write a conversion script in Gimp via command line? I'm looking at this article trying to figure out the commands, but I think my trouble is I don't know ScriptFu worth anything.
It would also be tremendously helpful if I can echo back the dimensions of the original PSD, but I can get these from the resulting file fairly easily with a second step.
2Interesting that you say that the Gimp has great support for PSD. I have had a lot of problems loading any PSD files with the Gimp, at least under Linux (I don't really use MS-Windows). Now on the other hand I have more luck with convert to convert PSD files, something like this:
convert sample.psd[0] sample.jpg
. The[0]
index is to get the resulting image (all the layers merged on in image.) – Alexis Wilke – 2014-07-08T20:17:00.3971The [0] index is to get the resulting image (all the layers merged on in image.) ....... GREAT! Thanks!! – FireFoxII – 2018-12-03T19:52:53.727