Page 1 of 1
Text is not readable on jpeg files
Posted: 2013-12-26T03:10:19-07:00
by Carter J
Hi,
I am converting PDF files into jpeg files using the following command:
convert -resample 300 TESTTIF.tif -profile /tmp/test/ICCProfiles/Recommended/USWebCoatedSWOP.icc -profile "/tmp/test/ICCProfiles/Recommended/sRGB Color Space Profile.icm" TESTTIFFTOJPG.jpg
While using the above command I am getting issues with text on the PDF files, i.e., the text present on the output jpeg files is not readble while we are able to read the text on PDF file. If the file text has small font then we are not able to identify the text content also, it is not clearly visible. And for some files while converting the pdf to jpeg, the colors on the pdf and jpeg files are differing. If a PDF file has red color shirt image, then in the output JPEG file the color of the shirt is changed to maroon.
Please share your findings in this type of conditions.......
Thanks in advance
Re: Text is not readable on jpeg files
Posted: 2013-12-26T03:22:39-07:00
by snibgo
You probably need a "-density" setting, not "-resample".
Re: Text is not readable on jpeg files
Posted: 2013-12-26T04:31:53-07:00
by Carter J
Thanks @snibgo. I was able to read the text on the jpeg files after replacing the resample with density, but it does not resolve color issue.
Re: Text is not readable on jpeg files
Posted: 2013-12-26T04:49:34-07:00
by snibgo
If you put your PDF and JPEG files somewhere like dropbox.com and paste the links here, someone might take a look.
Re: Text is not readable on jpeg files
Posted: 2013-12-27T02:25:24-07:00
by Carter J
Re: Text is not readable on jpeg files
Posted: 2013-12-27T03:37:11-07:00
by snibgo
On Windows 7, viewing your PDF files with Adobe Reader, and the JPEGs with Microsoft Photo Viewer and Gimp, I can't see any differences.
What viewing tools are you using?
Re: Text is not readable on jpeg files
Posted: 2013-12-27T04:35:33-07:00
by Carter J
Hi @snibgo,
Please find the image url below in which I have compared the output jpeg with the PDF:
https://www.dropbox.com/s/k5knc0vhvg3lq ... erence.png
And we are also using different Convert commands with resize option also for resizing the output jpeg file. We are not able to read the content of the output jpeg files with this resize option also.
The commands we are using is:
convert -resize 800X600 /tmp/test/OrginalPDF.pdf[0] /tmp/test/OUTPUTJPG.jpg
convert -resize 9.372071227741332% /tmp/test/OrginalPDF.pdf[0] /tmp/test/OUTPUTJPG.jpg
Re: Text is not readable on jpeg files
Posted: 2013-12-27T05:34:23-07:00
by snibgo
Sorry, I don't know why you can see a difference. Perhaps one of your programs is applying extra colour management, or is bypassing Windows colour management.
"-resize" should come after the input file, not before it.
Re: Text is not readable on jpeg files
Posted: 2013-12-27T05:51:23-07:00
by snibgo
A thought occurs to me: NikeHighTops.jpg contains a profile (U.S. Web Coated (SWOP) v2) that is for CMYK images, but the file is sRGB. This might be confusing your viewer. If you added the profile, try it without. If it came with the profile, try stripping it.
Re: Text is not readable on jpeg files
Posted: 2013-12-27T06:34:20-07:00
by Carter J
After removing profiles also I was able to the reproduce the issue. I used a plain convert command
convert test.pdf test_convert.jpg.
And when I use this resize option, I was not able to see the text on the output image files. Is there any alternate for this resize???
I have modified the convert command to convert test.pdf -resize 800X600 test_convert.jpg. This command also did not produced a JPEG with readable text.
Re: Text is not readable on jpeg files
Posted: 2013-12-27T06:48:12-07:00
by snibgo
See my first reply: you probably need a "-density" setting.
Re: Text is not readable on jpeg files
Posted: 2013-12-27T07:02:06-07:00
by Carter J
@snibgo, We are converting this PDF's First Page to a JPG file in order to display the output file as preview of the PDF file.
And for converting the PDF we have different cases. In one case we might change the resolution of the Output. And in another we need to change the dimensions of the image. Perviously we are using resample for changing the output image resolution. As you said we resolved that by replacing the resample with density, which changes the resolution of the image.
Now we are having same issue that is text is not readable on the JPEG files while using resize option. This resize option will change the dimensions of the output Image file.
Re: Text is not readable on jpeg files
Posted: 2013-12-27T08:05:12-07:00
by snibgo
You can put a PDF on dropbox.com or similar and paste the URL here.
Re: Text is not readable on jpeg files
Posted: 2013-12-27T11:54:40-07:00
by fmw42
Now we are having same issue that is text is not readable on the JPEG files while using resize option. This resize option will change the dimensions of the output Image file.
This will be slower, but preserves quality. Use the supersampling method
convert -density 288 image.pdf -resize 25% -density XX image.jpg
This makes the density larger for the pdf so its size is larger and then scales it back down afterwards by the same factor.
nominal density is 72, so 4*72=288 and then resize by 1/4=25%
Re: Text is not readable on jpeg files
Posted: 2013-12-29T22:50:53-07:00
by Carter J
Thanks for the response, I have tried the following command for resize but this also failed to produce JPG file having readable text
We should take resize option value as per the requirement. We use this resize option in two different cases.
Case 1: Resize the output image file to
900X750
Case 2: Resize the output image file to
34.123456767%
The above two are sample values, We use different values for different scenarios. Due to this reason, I think for this requirement I am not able to follow this command even if it work.