webtoon / psd

Fast zero-dependency PSD parser for the web and Node.js
https://webtoon.github.io/psd
MIT License
1.21k stars 55 forks source link

feature: expose ICC profile #47

Closed scoiatael closed 2 years ago

scoiatael commented 2 years ago

fixes https://github.com/webtoon/psd/issues/46

I went for the dumbest implementation - just expose the underlying Uint8Array. As far as I can tell this produces a correct profile (can be opened and used with Little-CMS CLI tools).

I'll work next week on integrating emscripten Little-CMS build into our internal parser, so will come back with more feedback :)

I'm a little worried about our fixtures growing - this might be a potential repo bloat in the future, unless we start using something like Git LFS for them?

scoiatael commented 2 years ago

@pastelmind any chance on getting this reviewed? The good news is that it's enough to implement the conversion: I created simple demo.

windyrain commented 1 year ago

@scoiatael sorry to bother you. could you provide your simple demo source code , I want to restore color with icc profile srgb2.1, but i don't know how to do it, thank you very much ~

scoiatael commented 1 year ago

@windyrain there's actually a library we are currently working on inside OpenDesign with @alexspevak: https://www.npmjs.com/package/@opendesign/image-icc-profile-converter

It's currently very alpha, but it should spare you the pain of building C libraries via emscripten. If you encounter any problems or have more question, feel free to open an issue on https://github.com/opendesigndev/psd-ts describing details :)