Imagemagick convert
-
- Site Admin
- Posts: 15995
- Joined: Fri Jun 28, 2013 8:38 pm
- Location: USA, Zone 5b, Koppen Dfa, Elev. 620ft, Walkscore 77
- Contact:
Anyone really familiar with it?
I need to convert my pdf graphics into gif for the kindle version, but I keep stumbling. Maybe it's something that can be fixed in 5 minutes for those in the know.
Here's the wrong way to do it
convert specialistmoney.pdf -density 300 -resample 300x300 -units pixelsperinch -quality 100 specialistmoney.gif
The gif comes out all jagged.
I need to convert my pdf graphics into gif for the kindle version, but I keep stumbling. Maybe it's something that can be fixed in 5 minutes for those in the know.
Here's the wrong way to do it
convert specialistmoney.pdf -density 300 -resample 300x300 -units pixelsperinch -quality 100 specialistmoney.gif
The gif comes out all jagged.
Are you viewing the GIF at 1:1?
300 dpi is quite a bit higher resolution than most monitor screens. So I'm guessing what is happening is that you are converting the image properly (at 300dpi), but since your computer screen is 72 (or maybe 96dpi) the viewing program is resizing the image for display and not doing a good job of it.
If the kindle screen is say 72 dpi, don't you want to use -resample 72x72 ?
300 dpi is quite a bit higher resolution than most monitor screens. So I'm guessing what is happening is that you are converting the image properly (at 300dpi), but since your computer screen is 72 (or maybe 96dpi) the viewing program is resizing the image for display and not doing a good job of it.
If the kindle screen is say 72 dpi, don't you want to use -resample 72x72 ?
-
- Site Admin
- Posts: 15995
- Joined: Fri Jun 28, 2013 8:38 pm
- Location: USA, Zone 5b, Koppen Dfa, Elev. 620ft, Walkscore 77
- Contact:
@photoguy - I think you're on the right track. What I'm currently doing is resampling to 300dpi (which make the pics very large on the screen) and then resizing them afterwards.
What I think was/is the problem is that the images were/are too large to begin with.
This requires some manual calculations.
What I think was/is the problem is that the images were/are too large to begin with.
This requires some manual calculations.
I haven't used ImageMagick directly but I have used it via the PerlMagick interface -- and my experience when resizing is you need to set to 24-bit format first. That means PNG or JPG. Afterwards, you can convert again to GIF. But if you first initialize the work space as GIF, the resizing looks poor.
Via the perl interface, you can read the original image size and then calculate out the new size to preserve the aspect ratio.
Via the perl interface, you can read the original image size and then calculate out the new size to preserve the aspect ratio.