Convert PSD to PNG/JPG with ANT
I am playing around w开发者_开发技巧ith build processes and the idea came up to store our PSD's in our repository so when a build kicks off we can convert the PSD files to PNG/JPG images. This would be great because we wouldn't be reconverting the same compressed file over and over again and it would also allow us to change the image compression rate without any negative impacts to the final output...meaning we could one day compress at 60% and then go up to 80%.
Does anyone know of a library or way to accomplish this with an ANT taks or Bash?
There is actually an image task in ANT. I doubt however that it can handle PSD files though.
Another option is to use an external tool such as convert
from the imagemagick package:
<exec executable="convert">
<arg value="yourfile.psd">
<arg value="output.png">
</exec>
convert
has tons of options for cropping / scaling / setting quality and compression as well, so it should suit your needs.
精彩评论