WebP to PSD
Nothing you choose here leaves your browser, and nothing is downloaded to make it work — no library, no codec. Writing a PSD is a header and the pixels, laid out one colour channel at a time.
A WebP as a Photoshop document, transparency and all.
One layer. The alpha channel comes across, which is the main reason to start from a WebP rather than a JPEG. As above, this makes a flat document rather than an editable one: there is nothing in a WebP to make layers out of.
Photoshop already flattened it for you
This is the part that makes the page possible. A PSD holds the layers, and then at the end of the file it holds a flattened copy of the finished picture — every layer, mask, adjustment and blend mode already applied. Adobe put it there so that other programs could show a PSD without understanding Photoshop, and it is what this page reads.
So there is no compositing engine here and none is needed. Doing it the other way — stacking the layers yourself — means implementing twenty-odd blend modes, and that means fetching a library. Reading the copy Photoshop already made is a header, three lengths and a run-length decoder.
When the flattened copy is not the picture
Photoshop has a preference called “Maximize PSD and PSB File Compatibility”. With it off, Photoshop skips writing that flattened copy properly and the file gets smaller — and the picture then exists only as layers.
The file says which it is, and this page checks. There is a flag for exactly this purpose in the document's image resources, and a file that says its flattened copy is not real is refused here with the reason rather than converted. A converter that ignores the flag hands you a blank or an old version of your picture and reports success, which is worse than an error.
If you meet that message: open the document in Photoshop, and either turn the preference on (Preferences › File Handling › Maximize Compatibility: Always) and save again, or just export a PNG from there directly.
What is actually in one
| 8BPS | four bytes of magic, then a version: 1 for a .psd, 2 for the large-document .psb |
|---|---|
| height, then width | in that order, which is the wrong way round from every other format here |
| three sections | colour mode data, image resources, and the layers — each with its length in front |
| the composite | usually run-length encoded, and planar: every row of red, then every row of green, then every row of blue |
Planar is the one that catches people. Read those bytes as red-green-blue-red-green-blue and you get a picture in three coloured bands — it looks like a broken decoder and it is a wrong assumption about the layout.
CMYK is stored upside down
In a print document, 0 means full ink and 255
means none — the opposite of what the numbers look like.
Measured on a file holding 200, 90, 170, 240: psd-tools
reads it back as 55, 165, 85, 15, and so does Pillow, which
shares no code with it. Two separate readers, the same answer. Skip the
inversion and every CMYK document comes out as its own photographic
negative.
A CMYK document converted here gets the plain arithmetic and no colour profile. It will look close, and it is not what a press would print. If the colour matters, convert to RGB in Photoshop where the profile can be applied properly.
What it will not do
- It will not make layers. A flat picture has one layer and so does the document this writes: a background and no more.
- It reads 8 bits a channel. A 16- or 32-bit document is refused with the menu item that changes it, rather than being silently rounded.
- It reads uncompressed and run-length encoded documents. A zipped composite — which Photoshop writes in some versions — is refused by name.
- Indexed-colour and duotone documents come out as the raw channel in grey, because their colour table is not applied. It says so on screen rather than quietly handing you the wrong colours.