Text is not readable on jpeg files

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Text is not readable on jpeg files

Post 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
Last edited by Carter J on 2014-02-12T00:04:25-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Text is not readable on jpeg files

Post by snibgo »

You probably need a "-density" setting, not "-resample".
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Text is not readable on jpeg files

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Text is not readable on jpeg files

Post by snibgo »

If you put your PDF and JPEG files somewhere like dropbox.com and paste the links here, someone might take a look.
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Text is not readable on jpeg files

Post by Carter J »

Hi,

I have uploaded sample files in my dropbox. You can download them from the following links:

https://www.dropbox.com/s/8wxi7r2sj20g8 ... trends.jpg
https://www.dropbox.com/s/yhsmuja1swzdx ... trends.pdf
https://www.dropbox.com/s/2h6oxd0cmpej6 ... ghTops.jpg
https://www.dropbox.com/s/5ak1z77ityrsr ... ghTops.pdf
https://www.dropbox.com/s/j1dxuk97qjq2hl8/tshirts.pdf
https://www.dropbox.com/s/iviefo6ra5cu8id/tshirts.jpg

Please download these files to your desktop and see the differences in the colors for PDF file and corresponding jpeg file generated from the PDF file.

Thanks in advance......
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Text is not readable on jpeg files

Post 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?
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Text is not readable on jpeg files

Post 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
Last edited by Carter J on 2014-02-12T00:05:05-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Text is not readable on jpeg files

Post 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.
snibgo's IM pages: im.snibgo.com
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Text is not readable on jpeg files

Post 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.
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Text is not readable on jpeg files

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Text is not readable on jpeg files

Post by snibgo »

See my first reply: you probably need a "-density" setting.
snibgo's IM pages: im.snibgo.com
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Text is not readable on jpeg files

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Text is not readable on jpeg files

Post by snibgo »

You can put a PDF on dropbox.com or similar and paste the URL here.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Text is not readable on jpeg files

Post 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%
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: Text is not readable on jpeg files

Post 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.
Post Reply