3

I have some plots originally in the JPEG as well as in BMP format and I want to have the best possible output after compilation by Tex software. I have used the pdf format after having it converted with adobe photoshop but the quality deteriorated a lot. I haven't tried with the eps format yet but I don't know if it will work. Please suggest if there are better alternatives.

  • 1
    If the PDF is produced as a vector graphic (rather than a pixelated raster graphic), the quality remains perfect. See http://tex.stackexchange.com/questions/224357/create-latex-symbol-from-vector-graphics – Steven B. Segletes Oct 12 '16 at 13:35
  • 7
    If you start with a (bad) jpeg you can't improve it by converting it. You will have to recreate the plots as vector graphics. – Ulrike Fischer Oct 12 '16 at 13:43
  • Steven, I need a little more elaboration. Has this anything to do with the package {scalerel} ? How can I produce the 'vector graphic'?? Will the Tex software do the job if I use the package {scalerel} or will I need to use photoshop again ? – biswajit Oct 12 '16 at 13:47
  • Ulrike, the original plots DETERIORATED after conversion from JPEG/BMP into PDF with photoshop. How can I convert the bmp plot into a vector graphic ?? – biswajit Oct 12 '16 at 13:56
  • The scalerel package has nothing to do with vector graphics, only with the automatic scaling of images. The point of the link was that the original graphic (the argument of \includegraphics), by being created as a vector PDF file, would retain its resolution with arbitrary scaling. The key is to make sure the program creating your graphics is outputting them in vector form. For example, I use sigmaplot, which is able to output its results in vector form. Thus, those images, when imported into LaTeX, scale with no loss of resolution. – Steven B. Segletes Oct 12 '16 at 14:07
  • I am not a photoshop user to know what its options are. One approach increasingly used by LaTeX users is to employ the LaTeX package tikz to create their graphics directly within LaTeX. Of course, this entails learning a new programming language of tikz. See here for the possibilities: http://tex.stackexchange.com/questions/158668/nice-scientific-pictures-show-off – Steven B. Segletes Oct 12 '16 at 14:11
  • can 'sigmaplot' be used for conversion of 'bmp' files as well ? – biswajit Oct 12 '16 at 14:22
  • 2
    what was the software originally used to create the graphics? that is the software that must be used to produce a vector graphic. – barbara beeton Oct 12 '16 at 14:25
  • 1
    For the moment, I will assume that you cannot go back and re-create the vector drawing, and must start with the bmp. What is its resolution, in pixels (per inch or cm)? When you convert to pdf in Photoshop, what is the output resolution, in pixels per inch or cm? Could it be that the two are not the same? In particular, is the PDF being produced at 72dpi, when you ought to have 300dpi for quality print? –  Oct 12 '16 at 14:36
  • barbara, I had used LabVIEW to produce those plots and they happened to be in bmp format by default. It was only later that I realized that I did a bad job. Reproducing the plots will require me to do those practical experiments again and this is not an option. My only option now is to use the bmp files to get as good an output as possible. – biswajit Oct 12 '16 at 14:47
  • 1
    RobtA, thanks for your insights. I noticed that during the conversion of bmp files into pdf, the photoshop software was actually downsampling it. I just had to uncheck that box and pdf files were of remarkably better quality after that. This is all that I needed....Thanks to all... – biswajit Oct 12 '16 at 16:03

2 Answers2

6

If you have a BMP picture then I would recommend that you export it to the PNG format.

You can use almost every picture software to change the format from BMP to PNG including Microsoft Paint.

The PNG format will have the same quality (both are lossless) as the BMP version but will be smaller in file size.

The JPG format is not lossless and therefore will decrease the quality. Depending on the content of the picture this will be more or less obvious.

A typical photo (humans, animals, nature and so on) will be perfect for a JPEG format. Accuarte draqings with fine details will suffer more (too much) from the quality decrease.

See also my answer here for a comparison between the different picture formats.

A note on the PDF solution that is discussed in the comments

  • Converting a BMP file into a PDF file is not the same as converting it into a vector graphic.
  • The PDF format can contain different formats including pixel-orientated formats.
  • In most cases it makes no difference if you convert it into a PDF or a PNG.
  • With PNG you have more control over the format etc. and PNG files are easier to manipulate (cropping, color adjustments, ...).
  • Is there a way of directly using the 'bmp' format without having to go for the conversions ? – biswajit Oct 13 '16 at 13:49
  • 1
    @biswajit As far as I know not. If you use pdflatex (what you most likeley do) then you have to use either PNG, JPG/JPEG or PDF. See also https://en.wikibooks.org/wiki/LaTeX/Importing_Graphics#Compiling_with_pdflatex – Dr. Manuel Kuehner Oct 13 '16 at 14:26
1

Based on comments above, I will promote my own comment to an answer.

The OP's problem was that his original rasterized image was downsampled when he converted it to PDF. So, it had nothing to do with vector versus raster, or jpg versus png, or importing a PDF into a TeX document. It was a matter of ensuring that the original image was not downsampled by Photoshop in the process of converting it to PDF. This is a check-box setting in Photoshop.

I mention this because many commercial print services do not accept color or grayscale artwork above 300dpi, and will probably insist that vector artwork be flattened to raster. It's not hard to get 300dpi.