I'm new to ImageMagick so pardon me if this is a really stupid question.
I ran the command :
convert -format %w,%h, input.jpg -resize MxM> -identify output.jpg
where M is the longest dimension of the image, say the input is 1024x768, then M=1024, so I'm assuming the dimension of output image will be the same (and it is). However the image size get larger after converted. Say the input is 845941 bytes, the converted image using this command is 901649 bytes. Why is this?
I'm using ImageMagick 6.8.2 and the test input images are Windows sample pictures (the JPEGs that come with the Windows system).
Another question, I've heard that when ImageMagick do convert, it removes the header of the image. Is this true?
Thanks.
jpeg converted image get bigger than the original jpeg?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: jpeg converted image get bigger than the original jpeg?
IM reads the jpeg and decompresses it, does any processing, then re-compresses and writes it. You can adjust the amount of compression (and hence the quality) with "-quality".
However, jpeg is a lossy compression method. Everytime you read and write in jpeg, you always lose quality.
IM is wonderful at processing images but doesn't bother much about metadata. See the recent thread viewtopic.php?f=1&t=24537
However, jpeg is a lossy compression method. Everytime you read and write in jpeg, you always lose quality.
I don't even know what it means.Another question, I've heard that when ImageMagick do convert, it removes the header of the image. Is this true?
IM is wonderful at processing images but doesn't bother much about metadata. See the recent thread viewtopic.php?f=1&t=24537
snibgo's IM pages: im.snibgo.com
Re: jpeg converted image get bigger than the original jpeg?
What happened when you tried it?Another question, I've heard that when ImageMagick do convert, it removes the header of the image. Is this true?
If you -resize no data is stripped unless you specify -strip and then the EXIF data etc. is removed ( I can not remember if the colour profile is stripped ). If you use -thumbnail it is the same as using -resize and -strip.