Convert PDF to JPG: jpeg:extent=1024KB doesn't work
Convert PDF to JPG: jpeg:extent=1024KB doesn't work
IM version: Windows ImageMagick-6.9.2-4-Q16-x64-dll.exe
GhostScript version: 9.14
I want to convert a PDF document into a JPG picture.
Command: convert -define jpeg:extent=1024KB complete.pdf complete.jpg
The converted JPG has a very low quality and the restricted size of 1024KB is not reached.
I think this is a bug. I was trying some previous versions of IM (6.8.9_10 and lower) and everything works fine.
Can somebody confirm this behavior? Or what i am doing wrong?
Converting a JPG into a JPG with "-define jpeg:extent=1024KB", everything works fine.
GhostScript version: 9.14
I want to convert a PDF document into a JPG picture.
Command: convert -define jpeg:extent=1024KB complete.pdf complete.jpg
The converted JPG has a very low quality and the restricted size of 1024KB is not reached.
I think this is a bug. I was trying some previous versions of IM (6.8.9_10 and lower) and everything works fine.
Can somebody confirm this behavior? Or what i am doing wrong?
Converting a JPG into a JPG with "-define jpeg:extent=1024KB", everything works fine.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
Post your PDF document so the IM developers or some one else can test with it.
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
Thanks for your fast reply.fmw42 wrote:Post your PDF document so the IM developers or some one else can test with it.
For example you can take this PDF:
http://www.mueller.de/uploads/tx_muelle ... mplete.pdf
Or this:
http://www.mueller.de/uploads/tx_muelle ... mplete.pdf
I must convert many PDFs into JPGs and the "bug" occurs on every PDF.
If you find an PDF where the "bug" doesn't occurs, please post this PDF.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
I cannot seem to download those files.
Also you might be better off getting a pdf tool to extract the jpg image and then using either that tool, another, or IM to write to a specific size.
Also you might be better off getting a pdf tool to extract the jpg image and then using either that tool, another, or IM to write to a specific size.
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
Sorry for the "bad" links. For me, the links are correct. Maybe the links are exclusive for germany.fmw42 wrote:I cannot seem to download those files.
...
I find some ".com" URLs with PDFs:
http://www.superbrands.com/lkc1/pdf/12_consumerSB.pdf
http://sunnydayguide.com/sarasota/dynam ... vities.pdf
I want to convert the complete pages of a PDF document (all inclusive: pictures, fonts, ...). I tried different other tools, but IM was mostly the best (very fast, good quality, needs less resources).
My final IM convert statement is:
convert -depth 8 -density 200 -alpha remove -colorspace sRGB -define jpeg:extent=1024KB test.pdf test.jpg
But with the latest version of IM the option "-define jpeg:extent=1024KB" doesn't work on my system.
Maybe somebody can confirm this behavior.
Thanks for your help.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
I can confirm that one gets a much closer value with older versions of IM
With IM 6.9.2.4 Q16 Mac OSX and no hint:
3.07MB
With IM 6.9.2.4 Q16 Mac OSX and with hint:
218KB
With IM 6.8.6.10 Q16 Mac OSX and with hint:
994KB
With IM 6.9.2.4 Q16 Mac OSX and no hint:
Code: Select all
convert -density 200 -alpha remove -colorspace sRGB 12_consumerSB.pdf \
-depth 8 12_consumerSB1.jpg
With IM 6.9.2.4 Q16 Mac OSX and with hint:
Code: Select all
convert -density 200 -alpha remove -colorspace sRGB 12_consumerSB.pdf \
-define jpeg:extent=1024KB -depth 8 12_consumerSB2.jpg
With IM 6.8.6.10 Q16 Mac OSX and with hint:
Code: Select all
im68610 convert -density 200 -alpha remove -colorspace sRGB 12_consumerSB.pdf \
-define jpeg:extent=1024KB -depth 8 12_consumerSB2.jpg
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
We can reproduce the problem you posted and have a patch in ImageMagick 6.9.2-5 Beta, available by sometime tomorrow. Thanks.
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
This bug was introduced due to this feature: viewtopic.php?f=2&t=27071&p=120318. A temporary workaround is specifying the 'max quality' with -quality=100.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
Documentation at http://www.imagemagick.org/script/comma ... php#define needs to be updated to explain the connection between -quality and this define.dlemstra wrote:This bug was introduced due to this feature: viewtopic.php?f=2&t=27071&p=120318. A temporary workaround is specifying the 'max quality' with -quality=100.
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
Would you be willing to help us with that Fred?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
If you can explain how -quality affects this define, I can change the docs. I really do not understand what was changed in the other topic and how it limits the -define.dlemstra wrote:Would you be willing to help us with that Fred?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert PDF to JPG: jpeg:extent=1024KB doesn't work
The JPEG encoder will search for the highest compression quality level that results in an output file that does notexceed the value. The -quality option also will be respected starting with version 6.9.2-5. Between 6.9.1-0 and 6.9.2-4, add -quality 100 in order for the jpeg:extent to work properly, due to a bug. Prior to 6.9.1-0, the -quality setting was ignored.