Reducing size of IM created PSD files

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
OlgerD
Posts: 15
Joined: 2015-06-01T21:53:02-07:00
Authentication code: 6789
Contact:

Reducing size of IM created PSD files

Post 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!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:

Re: Reducing size of IM created PSD files

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Reducing size of IM created PSD files

Post by dlemstra »

I am working on adding support for writing zip compressed layers. This might also reduce the size of the file.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
OlgerD
Posts: 15
Joined: 2015-06-01T21:53:02-07:00
Authentication code: 6789
Contact:

Re: Reducing size of IM created PSD files

Post 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.
OlgerD
Posts: 15
Joined: 2015-06-01T21:53:02-07:00
Authentication code: 6789
Contact:

Re: Reducing size of IM created PSD files

Post 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.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot] and 39 guests