Graphics, Figures & TablesMessed figure

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
safwatonline
Posts: 13
Joined: Tue Jun 29, 2010 6:46 pm

Messed figure

Post by safwatonline »

Hello All,

i am trying to add a figure using graphix package, i first convert it to eps (originally bmp) then add it using the following command:

Code: Select all

 \begin{figure}[!h]
 \centering
 \includegraphics[scale=0.7,keepaspectratio]{Images/chp2/Nasiri_Pack2.eps}
 \caption{Nasiri Fabrication Platform; CMOS-MEMS Structure}
 \label{fig2_nasiri}
 \end{figure}
the figure is really messed in resolution, i didnt add any compression option.
attached is the original figure and the eps file and the output pdf.
Attachments
Nasiri_Pack2.png
Nasiri_Pack2.png (20.96 KiB) Viewed 5663 times
Thesis 53.pdf
(28.58 KiB) Downloaded 322 times
Nasiri_Pack2.eps
(64.47 KiB) Downloaded 423 times

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: Messed figure

Post by Stefan Kottwitz »

Hi,

do you really nead the way via eps and LaTeX in dvi mode?

I would convert the bmp image to png (lossless, also bitmap), and use pdfLaTeX.

Stefan
LaTeX.org admin
safwatonline
Posts: 13
Joined: Tue Jun 29, 2010 6:46 pm

Re: Messed figure

Post by safwatonline »

Dear Stephan,
Thanks a lot for your reply.
First, i am really a newbie in Latex so i don't really understand all the options.
Second, i tried using jpg, but i had to set the bounding box manually, which is not really practical with large number of figures, and the output was a mono-chrome figure with messed resolution. Do i need to set the bb for png and can i do scaling with png?
Third, Can i change the backend for this figure only as other eps figures are working fine and i dont want to mess with them
Fourth, i really dont understand were the loss of quality come from since the jpg file and eps seems Ok
Five, would you please write the exact code you would be using for good resolution on this figure?

thanks again.
regards,
Safwat
safwatonline
Posts: 13
Joined: Tue Jun 29, 2010 6:46 pm

Messed figure

Post by safwatonline »

Just to make myself clear, i am not really familiar with what you said :D
So, what i am doing is:

Code: Select all

\usepackage[dvips]{graphicx} 
and i am using Latex to PS to PDF
with latex as my compiler and Ghostscript for ps2pdf

is there something wrong here?
Last edited by Stefan Kottwitz on Wed Jun 27, 2012 12:07 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Messed figure

Post by Stefan Kottwitz »

If you can work with png or jpg images instead of eps, write

Code: Select all

\usepackage{graphicx}
without driver option, because it's auto-detected, and use LaTeX=>PDF as output profile, i.e. pdfLaTeX.

This way specifying a bounding box is not required. Btw. png uses lossless compression, in contrast to jpg, so the quality can be better.

Stefan
LaTeX.org admin
safwatonline
Posts: 13
Joined: Tue Jun 29, 2010 6:46 pm

Re: Messed figure

Post by safwatonline »

Hello Stephan,
Thanks a lot for ur response.
I tried that then the figure is working fine. However, all other figures are messed up with unrecognized eps. can't i have both, i certainly don't want to re-make all other figures.
BTW what is the main advantages and disadvantages of using PS=>PDF or PDF directly

regards,
Safwat
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Messed figure

Post by Stefan Kottwitz »

Try the same way, but load this package for supporting your eps figures:

Code: Select all

\usepackage{epstopdf}
Stefan
LaTeX.org admin
safwatonline
Posts: 13
Joined: Tue Jun 29, 2010 6:46 pm

Re: Messed figure

Post by safwatonline »

it is working now (u r the man :D)
One last thing, the pages with png figures now looks different from other pages, the colors mainly is not the same (more bold color), how to fix that?

attached both pages for reference.
Attachments
Pages from Thesis.pdf
(70.74 KiB) Downloaded 351 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: Messed figure

Post by Stefan Kottwitz »

I cannot see a difference here, at first sight. I know that PDF readers can have problems if PNG images use the alpha channel, i.e. transparency, which can result in bolder text, in the reader. Probably not in the print. If you just need the print, check this. If you need the electronic version, try and remove the alpha channel in the PNG image with graphics software, or convert (maximum quality, without loss) to jpg, and compare.

Stefan
LaTeX.org admin
safwatonline
Posts: 13
Joined: Tue Jun 29, 2010 6:46 pm

Re: Messed figure

Post by safwatonline »

i think it is much better with jpg, thanks a lot for your help :)
Post Reply