psd icon indicating copy to clipboard operation
psd copied to clipboard

Implement PSD write support

Open ajjahn opened this issue 1 year ago • 6 comments

A work in progress, looking for feedback. Among other things, the layer and mask information is still incomplete.

It has become apparent that in order for writing PSDs to be useful, an API for modifying Psd needs to be designed and implemented.

ajjahn avatar Aug 30 '24 13:08 ajjahn

want to collab on this?

That would be ideal. I think we need to start a conversation about the API for creating/updating a Psd object in order to write it out as a .psd file. I think that might impact how the internals are represented due to the fact that up until now this library has only read bytes in. We probably need @chinedufn to jump into that conversation too.

My particular use case is to transform a proprietary image composition document type into PSD. That will mean needing to create pixel layers, text objects, set blending modes, using adjustment layers, group and layer masks, even potentially using effects.

ajjahn avatar Aug 30 '24 20:08 ajjahn

Sounds good to me. My use case is much simpler, I just need to be able to load a standard image type into a layer and save it. So I believe it would get wrapped up into your spec list.

mexicantexan avatar Sep 03 '24 15:09 mexicantexan

I haven't looked at this PR yet, but if it doesn't contain any tests then that would be something to think about since we don't want to land any untested functionality.


We can follow the approach laid out in https://github.com/chinedufn/psd/issues/61#issuecomment-2328520087 until we have enough implemented to support both of your needs.

I'll make myself available to answer questions and review code.

chinedufn avatar Sep 04 '24 10:09 chinedufn

@ajjahn could you add me as a contributor to your fork?

mexicantexan avatar Sep 11 '24 17:09 mexicantexan

@ajjahn I took some time last night to read through your progress so far and implemented some missing features (specifically around blending) that I think are going to be necessary for us.

Great work so far! I guess I'll ask where would you like me to push my efforts first? Which parts do you see as your largest painpoints/unknowns?

mexicantexan avatar Sep 13 '24 16:09 mexicantexan

@ajjahn Just following up on my previous

mexicantexan avatar Nov 09 '24 15:11 mexicantexan

@ajjahn @chinedufn basic round-tripping (read -> save -> read) seems to be functioning

mexicantexan avatar Aug 19 '25 16:08 mexicantexan

@chinedufn what would you need from me to merge this PR?

mexicantexan avatar Aug 20 '25 21:08 mexicantexan

I think we can at least mark this PR as ready for review.

ajjahn avatar Aug 21 '25 13:08 ajjahn

@chinedufn Just following up on this

mexicantexan avatar Aug 26 '25 21:08 mexicantexan

Planning to review next week.

Main thing I'll be looking for:

  • all of the functionality is tested
    • every test should include a doc comment that explains what is is verifying.
      • /// Verify that ...
  • the new types/functions/methods/ are well documented

I'm noting this in case you want to look it over first. We will not merge any untested functionality.

Otherwise, I'm planning to review this next week.

Thank you for your efforts here.

chinedufn avatar Aug 29 '25 11:08 chinedufn