'convert' produces bad quality since update to Ubuntu 12.04
-
- Posts: 6
- Joined: 2012-04-17T04:05:25-07:00
- Authentication code: 8675308
'convert' produces bad quality since update to Ubuntu 12.04
I have recently updated from Ubuntu 11.10 to Ubuntu 12.04. Since then, a 'convert' script which I have used for years suddenly started producing worse quality (jagged edges, no dithering anymore?).
Here's the script:
convert -density 150 '/path/file.pdf' -colorspace Gray -strip -quality 85 '/path/file.jpg'
Here's how the resulting jpg used to look before:
And here's how it looks now:
Version: ImageMagick 6.6.9-7
Any ideas?
Thanks in advance!
Here's the script:
convert -density 150 '/path/file.pdf' -colorspace Gray -strip -quality 85 '/path/file.jpg'
Here's how the resulting jpg used to look before:
And here's how it looks now:
Version: ImageMagick 6.6.9-7
Any ideas?
Thanks in advance!
Last edited by Mountain_Geek on 2012-04-17T08:08:05-07:00, edited 1 time in total.
Re: 'convert' produces bad quality since update to Ubuntu 12
Your images aren't visible (just the word "Image" appears in your message).
Can you post them (along with the pdf) on a web page somewhere?
Were you using the same ImageMagick version before? If so the difference
is probably in your PDF decoder or possibly in the JPEG encoder.
What happens if you convert to a lossless format such as PPM? If it
looks the same, that would say the JPEG encoder isn't to blame.
Can you post them (along with the pdf) on a web page somewhere?
Were you using the same ImageMagick version before? If so the difference
is probably in your PDF decoder or possibly in the JPEG encoder.
What happens if you convert to a lossless format such as PPM? If it
looks the same, that would say the JPEG encoder isn't to blame.
-
- Posts: 6
- Joined: 2012-04-17T04:05:25-07:00
- Authentication code: 8675308
Re: 'convert' produces bad quality since update to Ubuntu 12
Thx for your reply:
OK, the jpgs should be visible now. Posting the pdf file is useless: it happens with all pdf files regardless of the source.glennrp wrote:Your images aren't visible (just the word "Image" appears in your message).
Can you post them (along with the pdf) on a web page somewhere?
Good question: might be that the new Ubuntu release has automatically updated the ImageMagick version as well.glennrp wrote:Were you using the same ImageMagick version before? If so the difference
is probably in your PDF decoder or possibly in the JPEG encoder.
The ppms look crappy, too.glennrp wrote:What happens if you convert to a lossless format such as PPM? If it
looks the same, that would say the JPEG encoder isn't to blame.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: 'convert' produces bad quality since update to Ubuntu 12
By "updated", do you mean that you did not do a clean reinstall? Despite the best intentions of the the Ubuntu devs, me and my grad students have not found this to be a 100% pain-free way of moving to a more recent version of Ubuntu. (No clue if this applies to 12.04 from, I hope, a fully updated 11.10. We're still with Ubuntu 11.10/Mint 12.)
ImageMagick has a particular long and complex list of delegate libraries. For this reason, it, of all things, is likely to break when updating instead of doing a full install when changing major version of any OS.
I am far from sure that this is what's going on. But I figured you should know.
ImageMagick has a particular long and complex list of delegate libraries. For this reason, it, of all things, is likely to break when updating instead of doing a full install when changing major version of any OS.
I am far from sure that this is what's going on. But I figured you should know.
Re: 'convert' produces bad quality since update to Ubuntu 12
Add -flatten to your command line:
- convert -density 150 -colorspace gray '/path/file.pdf' -flatten -quality 85 '/path/file.jpg'
- convert -density 600 -colorspace gray '/path/file.pdf' -flatten -resize 25% -quality 92 '/path/file.jpg'
-
- Posts: 6
- Joined: 2012-04-17T04:05:25-07:00
- Authentication code: 8675308
Re: 'convert' produces bad quality since update to Ubuntu 12
Thanks: The "flatten" parameter somehow drastically improves the quality of text on white background (which was the major issue)!convert -density 150 -colorspace gray '/path/file.pdf' -flatten -quality 85 '/path/file.jpg'
The second suggestion produces even better quality, however the decoding at higher resolution and then resizing takes quite a while and it is not really worth the extra time and file space...
BUT: I usually convert a number of pdf files at the same time and the expected result are separate jpg files. The "flatten" parameter, however, layers them all onto a single page! Is there a way around that?
Cheers!
Last edited by Mountain_Geek on 2012-04-25T01:43:28-07:00, edited 1 time in total.
-
- Posts: 6
- Joined: 2012-04-17T04:05:25-07:00
- Authentication code: 8675308
Re: 'convert' produces bad quality since update to Ubuntu 12
You are only too right, but every approach has its downturns. A clean install involves about as much work getting back to where you were before (in terms of all the little tweaks that accumulate over the years) as an update requires patching around...NicolasRobidoux wrote:By "updated", do you mean that you did not do a clean reinstall? Despite the best intentions of the the Ubuntu devs, me and my grad students have not found this to be a 100% pain-free way of moving to a more recent version of Ubuntu. (No clue if this applies to 12.04 from, I hope, a fully updated 11.10. We're still with Ubuntu 11.10/Mint 12.)
ImageMagick has a particular long and complex list of delegate libraries. For this reason, it, of all things, is likely to break when updating instead of doing a full install when changing major version of any OS.
I am far from sure that this is what's going on. But I figured you should know.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: 'convert' produces bad quality since update to Ubuntu 12
With text, use PNG. With pngcrush if you want to squeeze out every little bit. Make sure you get a PNG8 out of this, and strip.
JPEG is very ill-suited for text.
JPEG is very ill-suited for text.
-
- Posts: 6
- Joined: 2012-04-17T04:05:25-07:00
- Authentication code: 8675308
Re: 'convert' produces bad quality since update to Ubuntu 12
The converted files are subsequently used in an accounting software which can handle jpgs only...NicolasRobidoux wrote:With text, use PNG. With pngcrush if you want to squeeze out every little bit. Make sure you get a PNG8 out of this, and strip.
JPEG is very ill-suited for text.
-
- Posts: 6
- Joined: 2012-04-17T04:05:25-07:00
- Authentication code: 8675308
Re: 'convert' produces bad quality since update to Ubuntu 12
OK, I have finally figured out what helps: I have added -bordercolor white -border 0 -alpha off to the command line and there we go: fine result!