jpeg:extent issue

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
geen
Posts: 4
Joined: 2012-03-21T13:58:21-07:00
Authentication code: 8675308

jpeg:extent issue

Post by geen »

Hi all,

I'm trying to resize a jpg image from 1.5Mb to 500Kb:

# convert -define jpeg:extent=500kb print.jpg print33.jpg

Yet:

# ls -lah print*.jpg
-rw-r--r-- 1 root root 1.5M Mar 21 16:03 print33.jpg
-rw-r--r-- 1 root root 1.5M Mar 21 15:16 print.jpg

Image it's not resized.
Any clues ?

I'm using the latest stable version:

# convert|head
Version: ImageMagick 6.7.6-1 2012-03-21 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
....

Many thanks,
geen
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: jpeg:extent issue

Post by fmw42 »

It works fine for me under IM 6.7.6.1 Q16 Mac OSX Snow Leopard. I resized a jpg from 4MB to 500KB

Perhaps you need to post a link to your jpg input image.
geen
Posts: 4
Joined: 2012-03-21T13:58:21-07:00
Authentication code: 8675308

Re: jpeg:extent issue

Post by geen »

Ok,

Here's another test I made, with the below pic "print.jpg" :

http://i43.tinypic.com/2i8jblu.jpg


$ ls -la print.jpg -h
-rw-r--r-- 1 root root 94K Mar 22 04:55 print.jpg

$ convert -define jpeg:extent=10kb print.jpg print33.jpg


$ ls -lah print33.jpg
-rw-r--r-- 1 root root 86K Mar 22 05:05 print33.jpg

It might be because the values are too small, and convert it's failing the operation ?

Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: jpeg:extent issue

Post by fmw42 »

First you are using a different image name in your command than the file you uploaded. But your command works for me on the uploaded file though it only gets to 15kb rather than 10kb.


convert -define jpeg:extent=10kb 2i8jblu.jpg 2i8jblu_10kb.jpg



identify 2i8jblu.jpg 2i8jblu_10kb.jpg

2i8jblu.jpg JPEG 1599x973 1599x973+0+0 8-bit DirectClass 51.6KB 0.000u 0:00.009
2i8jblu_10kb.jpg[1] JPEG 1599x973 1599x973+0+0 8-bit DirectClass 15.2KB 0.000u 0:00.000
geen
Posts: 4
Joined: 2012-03-21T13:58:21-07:00
Authentication code: 8675308

Re: jpeg:extent issue

Post by geen »

The new name was generated automatically.
Weird that to me doesn't work as expected.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: jpeg:extent issue

Post by fmw42 »

compare the size results from identify yourimagename and your file system size. see if they are different
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: jpeg:extent issue

Post by anthony »

Their are lower limits on how much JPEG can compress images!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
geen
Posts: 4
Joined: 2012-03-21T13:58:21-07:00
Authentication code: 8675308

Re: jpeg:extent issue

Post by geen »

Yeah, that's the issue. Lower limits on how much an image can be compressed.

Thanks
Post Reply