Page 1 of 1

Reducing size of IM created PSD files

Posted: 2015-06-01T22:13:48-07:00
by OlgerD
When I create a PSD file with IM with the following command:

Code: Select all

convert ( -label "top" image1.png -background none -mosaic ) ( -label "middle" image2.png -background none -mosaic ) ( -label "background" image3.jpg -mosaic ) ( -clone 0--1 -mosaic ) -reverse "output.psd"
open it in Photoshop, and save it (no editing), the PSD file ends up approx 30% of the size that IM created. Why the difference? How can I accomplish the same with IM? Ie, create a PSD file that's a lot smaller using the same images?
The first 2 images I use are png's because they have transparent pixels (in fact, most of the two images are transparent, and basically contain a border only), the jpg is a photo.
Cheers!

Re: Reducing size of IM created PSD files

Posted: 2015-06-02T00:45:10-07:00
by snibgo
IM has a "-compress ABC" setting. However, the only setting that affects the size of PSD files is "RLE" or "RunlengthEncoded". This shrinks graphics files, but makes photographs larger.

Re: Reducing size of IM created PSD files

Posted: 2015-06-02T00:52:26-07:00
by dlemstra
I am working on adding support for writing zip compressed layers. This might also reduce the size of the file.

Re: Reducing size of IM created PSD files

Posted: 2015-06-02T01:54:49-07:00
by OlgerD
So does Photoshop compress (does it use zip?) layers? The difference is significant; if I create a PSD with IM from 2 PNGs and one JPG where the PNGs are basically 3 color images (white, red and transparent) and the JPG is a photo, I end up with a PSD size of 140MB or so. If I create a PSD of just the JPG (which is a 98% compression Jpeg of around 6MB) I end up with a 34MB PSD.
If I load the PSD consisting out of the 2 PNGs and JPG in Photoshop, and then save it (without editing anything), I end up with a resulting PSD of around 40MB. Still big, but a far cry from 140MB.
If PS does use zip to compress layers, then having zip as an option in IM would be awesome.
Not a big issue at the moment for me, and it's good to know it is likely to be implemented in the future.

Re: Reducing size of IM created PSD files

Posted: 2015-06-02T01:56:19-07:00
by OlgerD
I'll have a play with that and see what the impact is.
snibgo wrote:IM has a "-compress ABC" setting. However, the only setting that affects the size of PSD files is "RLE" or "RunlengthEncoded". This shrinks graphics files, but makes photographs larger.