You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started using this awsome library. But it has problems with large file (like 100MB and larger)("has problems" means cannot read several image layers). I know there is a lot of articles, saying that, this library is not suitable for large files. But it is possible. Look at https://www.photopea.com/. Its free online photoshop and it can read large .psd files.
I made some research. The problem is with using method toPng(): var des = psd.tree().descendants(); var img = (des.get('image')).toPng();
It returns an image of the layer. It works fine, but allocates a lot of memory, which is not released (for example for 100MB psd file, allocates 300MB for one image (layer)). Its because after using toPng() method, the object psd stores information about layer, like pixelData and so on.
This is 100% fine. But why the pixelData stores information (which are only integers between 0-255) as an classic array. I suggest use Uint8ClampedArray array. I believe that this improvement will reduce the memory size of the pixelData array more than 10 times.
This Uint8ClampedArray array is used also in ImageData object (acquired from canvas HTML element). Here is a figure:
I hope my text is comprehensible to developers at least.
The text was updated successfully, but these errors were encountered:
I have already seen your issue (#139) and your solve. I forgot to mention that i am using this library in browser (the psd.js file (or psd.min.js file)). And these files are not corrected. Or I didnt find the right ones.