Hello!
I have tried to find a solution for my problem but I couldn't.
I first convert a PDF file to JPG and then if user wants to, rotate
the image but rotation makes text little blurry. The image is an invoice.
White background and black text. But after rotation the text get some
gray background. Is it possible to rotate without those side-effects?
Best regards!
Rotattion makes text blurry
Re: Rotattion makes text blurry
Hello!
Blurriness is less if I don't change the quality.
-quality 90 gives blurriness
-quality 100 seems to work fine
Blurriness is less if I don't change the quality.
-quality 90 gives blurriness
-quality 100 seems to work fine
Re: Rotattion makes text blurry
Try this command to lessen the blurriness of your image:
- convert -density 400 text.pdf -resize 25% -quality 100 image.jpg
Re: Rotattion makes text blurry
Hello magick!magick wrote:Try this command to lessen the blurriness of your image:
- convert -density 400 text.pdf -resize 25% -quality 100 image.jpg
I'm almost doing that.
This is the command I run to convert PDF to jpg
Code: Select all
convert -density 300 text.pdf -scale 900 -quality 100 text.jpg
Having quality 90 distortion gets very visible.
I'm running with density -300 because it's faster and it gives quite good quality images.
Best regards and thanks for the help!
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Rotattion makes text blurry
Going back to the original query....
First do not save to JPEG, when you are NOT finished processing the image. That image file format is lossy and will loose color and blur sharp edges as it attempt to do extreme image compression.
Second the technique of creating a larger version of the image the shrinking is known as 'Super-Sampling'
http://www.imagemagick.org/Usage/distorts/#super_sample
basically by working with a larger image then resizing the final image you increase the number of pixels per final pixel, removing any small edge noise or blurring that results from image processing.
For PDF the noise is 'Aliasing Effects' from rasterization.
For Rotation it is interpolation or distortion noise.
now you were complaing of rotation blur. so the recommended solution is..
1/ read you PDF at the larger -density
2/ rotate or otherwise 'fix' the image as needed
3/ NOW -resize or -resample the image to its final size
4/ write the image into its final file format
And do NO more processing of the image.
NOTE if you always do all your processing starting with the source image you will get the best quality.
First do not save to JPEG, when you are NOT finished processing the image. That image file format is lossy and will loose color and blur sharp edges as it attempt to do extreme image compression.
Second the technique of creating a larger version of the image the shrinking is known as 'Super-Sampling'
http://www.imagemagick.org/Usage/distorts/#super_sample
basically by working with a larger image then resizing the final image you increase the number of pixels per final pixel, removing any small edge noise or blurring that results from image processing.
For PDF the noise is 'Aliasing Effects' from rasterization.
For Rotation it is interpolation or distortion noise.
now you were complaing of rotation blur. so the recommended solution is..
1/ read you PDF at the larger -density
2/ rotate or otherwise 'fix' the image as needed
3/ NOW -resize or -resample the image to its final size
4/ write the image into its final file format
And do NO more processing of the image.
NOTE if you always do all your processing starting with the source image you will get the best quality.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Rotattion makes text blurry
Thank you very much for your help Anthony!
My task is this:
1. Make all incoming PDF files showable in the application dialog. I need to convert PDF to some image files so they can be shown.
2. Fast and use as little hard drive as possible.
3. Do it with so good quality as possible
My test shows that JPG gives smallest images with sufficient quality.
I tried to use PNG but images gets about 30% bigger and they are not
noticeable better. PNG was my first choice.
User that use our software need to see the file before he tries to rotate. PDF files that converts to JPG will not be rotated.
But user may rotate files other then PDF.
I need to resize the file because we don't have enough good dialog object(widgets) that can show the file in good way.
bla bla bla
I'll look at super_sample and return.
Thank you very much for all help and great software.
Best regards!
My task is this:
1. Make all incoming PDF files showable in the application dialog. I need to convert PDF to some image files so they can be shown.
2. Fast and use as little hard drive as possible.
3. Do it with so good quality as possible
My test shows that JPG gives smallest images with sufficient quality.
I tried to use PNG but images gets about 30% bigger and they are not
noticeable better. PNG was my first choice.
User that use our software need to see the file before he tries to rotate. PDF files that converts to JPG will not be rotated.
But user may rotate files other then PDF.
I need to resize the file because we don't have enough good dialog object(widgets) that can show the file in good way.
bla bla bla
I'll look at super_sample and return.
Thank you very much for all help and great software.
Best regards!