I am trying to append multiple png's into a single large image with the following command:
convert -append *.png bigtest.png
This works and concatenates the png images together in an up and down manner (which is what I am looking for). The problem is that the resulting file is 249.9KB while the 4 source tiles total 47.8KB. I want as few (or preferably no changes), made to the images as they are concatenated. Running identify against the images yields the following changes:
original image(s):
Compression: JPEG
Quality: 90
resulting image:
Compression: Zip
I have tried a number of commands to override the compression setting of convert, without success. The montage command seems to handle similarly. Any ideas on what I am doing wrong? If you need more details or an example image... please speak up. Thx in advance
IM version = 6.8.9-9
Libpng version = 1.2.50
Zlib version = 1.2.8
Appending multiple png files causes large relative file size growth
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Appending multiple png files causes large relative file size growth
As far as I know, IM cannot write png files with jpeg compression. If you want jpeg compression, either write to a jpg file, or to a tiff with "-compress jpeg".
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Appending multiple png files causes large relative file size growth
FYI, proper IM 6 syntax has the input images first, then the function, then the output. But this likely will not matter. See http://www.imagemagick.org/Usage/basics/#whyconvert -append *.png bigtest.png
I agree with user snibgo. See http://www.imagemagick.org/script/comma ... hp#quality for types of compression and quality settings for png. I believe PNG uses LZW compression. Tiff or JPG can use JPG compression.
Try using PNG8: for output, for smaller size
Code: Select all
convert *.png -append PNG8:bigtest.png
Re: Appending multiple png files causes large relative file size growth
I tried the approach with the PNG8 output and the image color washed out. The main goal here is to get these images assembled into a much larger image with minimum loss and file size gain. I am not limited to png files at this point. Any thoughts on how to accomplish this? Many thanks for your assistance...
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Appending multiple png files causes large relative file size growth
My page "Outputs: speed and size" may provide some guidance.
If you upload sample images, perhaps we can be more specific.
If you upload sample images, perhaps we can be more specific.
snibgo's IM pages: im.snibgo.com
Re: Appending multiple png files causes large relative file size growth
I have run quite a number tests on the images I have. At first I didn't want to use jpeg compression (due to potential loss from re-compression), but after a real close look, I have determined that its minimal to not perceivable in this instance. Lets call this one closed. Thanks for everyones help!
Re: Appending multiple png files causes large relative file size growth
Apparently your input images were in fact JPEGs not PNGs, that happened to incorrectly have the .png extension. Your output from "convert" is a PNG, which unsurprisingly has a larger file size. So your best solution, which you have already discovered, is to write the output as a JPEG. Use the same quality (90) as the input flles, to avoid excessive quality loss.BadLander wrote:I am trying to append multiple png's into a single large image...
Running identify against the images yields the following changes:
original image(s):
Compression: JPEG
Quality: 90