开发者

Make and edit .psd file in iPhone file system

I w开发者_如何学Goas wondering what the easiest way to make a .psd file from within an iPhone app. I am making an app just like the Layers app, and I can't fiure out how he makes and edits .psd files.


Writing a psd parser yourself is a futile business. See the super-famous quote from here (original source code)

            // At this point, I'd like to take a moment to speak to you about the Adobe PSD format.
            // PSD is not a good format. PSD is not even a bad format. Calling it such would be an
            // insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having
            // worked on this code for several weeks now, my hate for PSD has grown to a raging fire
            // that burns with the fierce passion of a million suns.

It goes on and on. So, look for an (open-source) psd reading/writing library.


I'm the author of the Layers app the OP mentioned. Unfortunately, coneybeare is right - I pretty much wrote an objective-c implementation from scratch. The trick turned out to be basing it off a very old version of the PSD spec, from before it got insanely polluted with crap. Layers actually writes Photoshop 3 files.

UPDATE: I've published the PSDWriter from Layers on github. You can use it to write PSD files from a set of UIImages on iOS or Mac OS X: https://github.com/bengotow/PSDWriter

Enjoy!


Checkout ImageMagick. There's an iOS compiled binary that you can link into your application. Or if you want, you can set up the compilation business yourself.


They probably looked up the spec for the psd format, then figured out how to write it manually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜