-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exporting masks as pixmaps or vectors #161
Comments
Any opinions on this please? |
You can get the vector masks via getLayerShape, the pixel masks aren't supported yet, but we could in the future. |
@marekhrabe Just FYI, the https://github.com/adobe-photoshop/generator-core/blob/master/lib/generator.js#L746 I'm marking this as a feature request so that we can prioritize it appropriately and hopefully get pixel masks (and, pixel representations of vector masks) supported in the near future |
@marekhrabe I also should note that the |
It would be nice to be able to export masks as we would like to export unmasked image and it's mask separately and join them later in our app. Can I help somehow to implement this? |
@marekhrabe You can apply for a job at Adobe. :-) Unfortunately, getting a pixel mask requires a change on the native side. I assume the vector mask stuff is already working for you? @timothynoel when you come up for air, could you weigh in on what the timeline might look like for adding the ability to get pixel masks (and an unmasked version of the regular layer pixels)? I'm happy to do the legwork on the JS side (post-15.2. obviously). Thanks! |
I think you could disable the masks with a "layerSettings" array/dict. I don't have the format/exact code handy though. Returning the mask though would need some extra work. Mostly just connecting the Generator API with the Photoshop library API that already supports this. |
I have tested or looked up the things we are takling about and this is the state of any kind of mask support:
Can you talk about this and tell me if it is possible to implement the missing parts and what priorities it has? I'd really like to implement all this using generator and avoid any kind of parsing PSD, because… you know :)) |
@marekhrabe thanks for doing this spelunking. @timothynoel could you weigh in a bit more on the two "unchecked" items in the comment above? I think you've said that the first item (Exporting raw (unmasked) layers) might be possible now -- if it is, could you give us a few more details about what parameters to use? I don't see anything in the I know you've said that getting pixmaps of bitmap masks is not supported at all right now. I also know you're looking for 15.3 tasks. Maybe this could be one? 😄 Thanks! |
Adding mask thumbnails: the machinery for creating these already exists inside Photoshop, I just need to add another key to sendLayerThumbnailToNetworkClient. But.. I'd really recommend we hook up greyscale/single channel pixmap support in Generator so we don't have to send it as ARGB. As for disabling masks, and layerSettings, it's not for the faint of heart, and it's not super-well tested. It's very easy to get wrong, and you're code needs some knowledge of the layer stack beyond any single layer you're getting. I'd really recommend waiting for an actual direct API/param for this, and that would be easier to use, and faster internally. And it would be easier than trying to explain how to use layerSettings. Anyway here's the lowdown: The easiest way to discover the format of layerSettings, is to make a comp, then get doc info on the document, and search for "layerSettings". Here's such a layerSettings dictionary with the vector/layer mask disabled. (in fact "layerSettings" is kind of an impromptu comp that's applied to the layer before the thumbnail is obtained)
To use it, you need a "layerSettings" list of descriptors, one for each layer, each of which contain a "layerSettings" descriptor with the above format. If you're using the range format the list is lastLayer - firstLayer + 1 entries. In the single layerID, case, you need to know exactly how many layers are involved in the thumbnail (which makes it difficult to use, as you may be including children, or adjustors, or clipped layers) There's sample code using layerSettings, here: #120 (comment) |
I did additional support for 1 and 3-channel pixmaps for convert (as xmp.js already supports these three). Pull req in #268 I agree, the layerSettings way seems too complicated for this relatively simple task. Some API will be handy |
@timothynoel Thanks! @marekhrabe I agree, we should make an API for this. We'll add it to our backlog, but of course PRs are welcome. (Thanks again for all your help thus far.) |
This is the last type of data that are stored in PSD, we have their metadata available in JSON, but can't be actaully exported, as far as I know, to formats like PNG or SVG. Are there any plans to support this?
The text was updated successfully, but these errors were encountered: