Hi,
I'm trying to convert the layers from a psd file, each in a png on its own. The problem I have is that the layers don't fill the canvas, so each png file is created with a different size, depending on how much graphics is on them. I need them to keep the same size as the psd, their exact position and the transparency too.
PSD to PNG keep size
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PSD to PNG keep size
You might post a URL to the PSD.
Do a "identify -verbose" on the output PNGs. You might find each has a virtual canvas, and a "-flatten" on each will do the job.
Do a "identify -verbose" on the output PNGs. You might find each has a virtual canvas, and a "-flatten" on each will do the job.
snibgo's IM pages: im.snibgo.com
Re: PSD to PNG keep size
OK, here's a link: http://rapidshare.com/files/406731031/b ... 3.zip.html
Wouldn't flatten remove the transparency, though?
And keep in mind that I need the graphics to be in exact the same position as they are in the psd. For example, if I had a layer with just on pixel on it at the position 10x10, and the psd file has a size of 84x84, I need the resulting png to be 84x84 in size and that pixel to be at 10x10.
Wouldn't flatten remove the transparency, though?
And keep in mind that I need the graphics to be in exact the same position as they are in the psd. For example, if I had a layer with just on pixel on it at the position 10x10, and the psd file has a size of 84x84, I need the resulting png to be 84x84 in size and that pixel to be at 10x10.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PSD to PNG keep size
Flatten needs a suitable background, such as "None" for transparent.
The following Windows script might do what you want. The first convert creates file ba-1.png etc. There may be a single-command solution.
The following Windows script might do what you want. The first convert creates file ba-1.png etc. There may be a single-command solution.
Code: Select all
convert bigarrow.psd -layers TrimBounds ba.png
for %%f in (ba*.png) do convert %%f -background None -flatten %%f
snibgo's IM pages: im.snibgo.com
Re: PSD to PNG keep size
Perfect, man! Thank you!