Graphics, Figures & Tablescolours look different in adobe reader

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
wglmb
Posts: 3
Joined: Sun Feb 06, 2011 6:58 pm

colours look different in adobe reader

Post by wglmb »

I've created a graphic using Inkscape, and saved it directly as a pdf before inserting it into a document. But when I run it through pdfLaTeX and view the result in Adobe reader, it's much darker than the original.
I'm using TeXworks 0.3 r670 (MiKTeX 2.9) and the latest version of Adobe reader.

My code is:

Code: Select all

\documentclass[10pt,a4paper,landscape]{article}
\usepackage{wallpaper}
\begin{document}
\ThisCenterWallPaper{1.0}{bg.pdf}
test
\end{document}
where bg.pdf is this:
bg.pdf
The background
(14.13 KiB) Downloaded 202 times
The output I get is this:
poster.pdf
The output I get
(22.84 KiB) Downloaded 244 times

Here is a comparison of what I see when I open bg.pdf (left) and poster.pdf (right) in adobe acrobat:
comparison.jpg
comparison.jpg (131.29 KiB) Viewed 6370 times
However, poster.pdf displays correctly in TeXworks' viewer.



Any suggestions?
I realise it could just be a problem with Adobe reader, but I'm going to have to print this thing when it's done, and I want to be really sure the colours will turn out right. (and I can't do a test print, because I'll be taking somewhere to have it blown up to a poster-ish size)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: colours look different in adobe reader

Post by frabjous »

Even if the problem is with Acrobat Reader, that's probably not much of a consolation, since there's a good chance that's (or another Adobe product) what the printers will be using to print it.

I don't see why you couldn't do a test page. Even non-blown up, it might help you tell whether it's just a display issue.

Did you also try exporting from Inkscape in .eps format, and then creating via regular latex (then dvips/ps2pdf) and see if that made a difference?

Anyway, I looked at your attachments in a number of other PDF viewers. I couldn't tell any difference using MuPDF or evince. I think evince uses the same poppler rending engine as TeXworks does, so that's probably not much of a surprise. MuPDF uses a different one though.

I could see a difference when opening in Acrobat Reader (version 9 for Linux), though the difference was far less than it shows in your screenshot. Interesting, the amount of difference seemed to depend on zoom levels; the higher the zoom level, the less difference I could tell. (This makes me think they might still look the same printed.) I could also see a slight difference if I imported the images into the GIMP.

Here's another interesting thing. I ran poster.pdf through ps2pdf (which despite its name, can convert pdfs to pdfs(!) -- though it first converts to ps and then back to pdf). I'm attaching the result. When I open the result in Acrobat Reader, it looks different than either of the other two, though if anything it's lighter than bg.pdf. Very strange.
Attachments
poster-ps2pdf.pdf
(14 KiB) Downloaded 254 times
wglmb
Posts: 3
Joined: Sun Feb 06, 2011 6:58 pm

colours look different in adobe reader

Post by wglmb »

Thanks for the reply.
frabjous wrote:Even if the problem is with Acrobat Reader, that's probably not much of a consolation, since there's a good chance that's (or another Adobe product) what the printers will be using to print it.
Drat!
frabjous wrote:I don't see why you couldn't do a test page. Even non-blown up, it might help you tell whether it's just a display issue.
I did try, but the colour printer I have access to here at university is terrible. It gave me a weird ghosting effect. If I remember, I'll go to one of the IT rooms tomorrow and use one there.
frabjous wrote:Did you also try exporting from Inkscape in .eps format, and then creating via regular latex (then dvips/ps2pdf) and see if that made a difference?
Sorry, I don't understand what this means :oops:
I mean, I can export as .eps, but I don't know what you mean after that. Are you able to explain?
frabjous wrote:Here's another interesting thing. I ran poster.pdf through ps2pdf (which despite its name, can convert pdfs to pdfs(!) -- though it first converts to ps and then back to pdf). I'm attaching the result. When I open the result in Acrobat Reader, it looks different than either of the other two, though if anything it's lighter than bg.pdf. Very strange.
That is interesting! If I can't fix this problem, I'd like at least to be able to apply what you've done here to my final result, since that would look better I think.
Again, could you explain a bit more how you did this?


Thanks
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

colours look different in adobe reader

Post by frabjous »

wglmb wrote: Sorry, I don't understand what this means :oops:
I mean, I can export as .eps, but I don't know what you mean after that. Are you able to explain?
I'll try. There are different ways of processing a .tex file to create output. You've probably been using PDFLaTeX. But there are other options. You'll notice, e.g., that there is a dropdown menu of different things to run next to the "go" button in TeXworks.

For example, you might try "XeLaTeX" instead of "PDFLaTeX" (which, like PDFLaTeX, create a PDF file, but does so using the XeTeX engine rather than the PDFTeX engine), and see if the result looks any different in Acrobat Reader. (Though when I tried XeLaTeX with the same code, I didn't notice any difference from poster.pdf personally.)

The original program to use to compile a LaTeX file was simply called "LaTeX", and with MikTeX you surely have that installed as well. These programs use different output drivers, and hence interact with graphics in different ways. PDFLaTeX, for example, supports PDF, PNG and JPG graphics. Plain LaTeX, however, supports post-script based EPS graphics instead of PDF graphics.

The only problem is that TeXworks, if I remember right, does not define an output profile for LaTeX by default. This is probably because TeXworks assumes you want to use its built in PDF preview, and plain LaTeX outputs a DVI file rather than a PDF file. However, it is possible to convert a DVI file to a PDF file. The safest way of doing so involves two other programs, one called DVIPS, which also comes with MikTeX, which converts DVI files to PS (postscript) files, and another one called PS2PDF, which comes with Ghostscript, which converts PS files to PDF. You probably have Ghostscript installed, since most guides which tell people how to install LaTeX recommend installing Ghostscript as well. (And in case you don't, you can get Ghostscript here. It's free and open source software too.)

So I was suggesting that you try exporting the image to EPS in Inkscape, and then use it as background with the file, processing with plain LaTeX rather than regular LaTeX; to get a PDF file you could then convert the DVI that LaTeX outputs to PS and then convert that to PDF. In order to do this, you'd either need to add a LaTeX/DVIPS/PS2PDF output routine to TeXworks (instructions here -- though I've never tried this!), or else process everything from the Command Prompt (or use a different editor).

The commands should be:

Code: Select all

latex poster.tex
dvips poster.dvi
ps2pdf poster.ps
But that assumes all these commands are in your path of executable files, and I'm not sure if they are if you're using MiKTeX on Windows. I use linux, not Windows. Probably you could put in the full path to these programs instead, e.g.,

Code: Select all

"C:\Program Files\gs\gs9.00\bin\ps2pdf.bat" poster.ps
Or something like that, but I don't have access to a machine running Windows so I can't check the exact paths to use or test any of that.

I actually tried that (converting bg.pdf to bg.eps using pdftops, another tool that comes with ghostscript), and that did seem to make a difference too. I would post the output here, but it's just over the file attachment limit in size.
That is interesting! If I can't fix this problem, I'd like at least to be able to apply what you've done here to my final result, since that would look better I think.
Again, could you explain a bit more how you did this?
As I mentioned above, ps2pdf is a program that comes with Ghostscript that is typically used to convert PostScript files to PDF files. However, it can also be used to convert PDF files to PDF files, by converting to PostScript and then back to PDF. The way I did it is via the command line:

Code: Select all

ps2pdf poster.pdf poster-ps2pdf.pdf
Of course, I used the Linux command line. I don't know if it's quite so easy if you're using Windows, but maybe something like:

Code: Select all

"C:\Program Files\gs\gs9.00\bin\ps2pdf.bat" poster.pdf poster-ps2pdf.pdf
From the Command Prompt/DOS prompt would do the same? Again, I can't test that. You'd have to check the exact path to ps2pdf and ensure that it's ps2pdf.bat not ps2pdf.exe or some other nonsense you only have to deal with on Windows. (Here's where I would normally launch into a anti-Microsoft diatribe, but I'll spare you for the moment...)
wglmb
Posts: 3
Joined: Sun Feb 06, 2011 6:58 pm

colours look different in adobe reader

Post by wglmb »

Thanks, I'll try to get that to work. :)

A bit of research suggests the problem stems from colour models:
{TeX} SE - PDF colour model and LaTeX


Edit: Actually, before trying to get your method to work, I thought I'd try printing to a pdf-writer (CutePDF) from the TeXWorks viewer. The result was lighter than the original, but not as light as your one - so I might live with that :)


Edit: actually, doing that converts the whole thing to a picture embedded in a pdf, so it might become jagged when it's blown up
Post Reply