Software for exporting a phylogenetic tree as a jpeg?

I’m not sure whether this falls under anyone’s area of expertise, but I thought I’d ask anyway.

Do you know of any free software that would allow me to save a phylogenetic tree as a .jpeg or any other common type of image file? I can generate a tree as a .tre file, but I don’t have any software that would save it as an image file that I could then use in a document or in a PowerPoint presentation. It would be really nice to have a better method than to print out the tree on a piece of paper and then scan it in.

Hit the “Prnt Scrn” button, then go to MS Paint and hit “Paste.”

I don’t have a native print screen function with my computer (Windows 7). I have tried using screen capture programs like HyperSnap, but the image quality that results isn’t good enough for publication.

I’ve never seen a PC where the “Prnt Scrn” button didn’t work (the one on the keyboard in the upper right hand corner). I just want to make sure we’re talking about the same thing.

is there a ‘PrtScn’ key on your keyboard? you need to have the whole object on the screen to get it without later pasting together images.

Just in case someone doesn’t know this, the “Print Screen” button does not send the screen image to a printer. It only transfers an image to that invisible location known as The Clipboard. There is no confirmation of this action. But the image can be pasted into a graphic program and handled just like any other image afterwards.

OK, the Print Screen button is there and works.

But the image quality that results from doing this is not suitable for a publication, by a long shot.

Got any better ideas?

I’m pretty sure you’re stuck then unless the program has the ability to a picture, or at least an intermediate format that can be converted to an image.

If it can generate an HTML file it might save the tree as an image along with the webpage.

By the way, you really don’t want to use .jpeg for a tree, .jpegs are meant for complex images like pictures of real life. The JPEG compression isn’t meant for clean, straight lines and text, it’ll make it look like crap. Use PNG instead.

Image format guide: http://www.r1ch.net/img-formats/

ETA: Depending on why you thought the quality wasn’t good enough, use PrintScreen again, but save as PNG. If you were talking about it getting your whole desktop instead of just the tree, then you just have to spend a little effort cropping it. (Alt+print screen will only capture the active application, but you’ll still probably get a little extra stuff)

There are many, many phylogenetics programs in the world. I’m just looking for one that can export high-quality image files. So, no, if the three programs I already have can’t achieve what I want, I am not necessarily stuck.

The poor image quality of Print Screen first shows up when I paste the image file into any program where I can crop the image, not when I try to save it as any particular file type.

If you can find something to output your tree as PGF/TikZ, you can compile that to pdf and convert it to any format you like. Google suggests that there are tools out there, but I don’t know which ones are appropriate for your needs.

get the image to show as big as you can and be all on the screen.

try irfanview, it preserves quality more than other image programs i’ve tried.

http://irfanview.tuwien.ac.at/

How do you convert PDFs into other file types? One of my programs can write to PDFs, but I don’t know how to convert that to a file type I can use.

What program are you using to do this? If it has its own Print feature, you can try Printing to a PDF. You still can’t embed the PDF in a .doc or .ppt but you might be able to work with it easier.

Hopefully, it has an actual “Export -> To PNG” or some other image format, have you looked for that already?

I wager because a screen capture is only 92 DPI and a typical printer outputs 300+ DPI. It looks pretty jaggy if the screen cap is all you have.

The print screen function is only as good as the resolution on your screen. If you have a very high-res screen and are running it in a hi-res mode, Print Screen will be a hi-res image.

And it would pay to get the image on the screen as large as you can before copying to the Clipboard so the cropping doesn’t modify it greatly. If you take a thumbnail from a large screen image, crop and enlarge, it will look like cropped crap.

I suggest avoiding PDFs except for final output; they’re great for final files, but not so great for intermediates. But if you can’t, Photoshop can import PDFs into a bitmapped graphic. I’m sure other programs can do it, too.

Have you tried importing PDFs directly into PowerPoint? (I don’t know if it works, but it might.)

Not a factor. DPI is meaningless here. What you want is lotsa dots; the dots per inch – forget it.

A screen cap of a 2048x1200 screen is not jaggy at all unless you enlarge the crap out of it. And if you have a graphics file or screen 2048x1200, it has the same info whether it is 96DPI or 300.

We’ll have to agree to disagree on this point I think. For something like this chart, which is basically lines and text, the jaggies would be obvious. (Especially when compared to the explanatory text around the diagram, which would be silky-smooth.) I would agree that a screenshot, even from a 2048x1200 screen, would be unsuitable for print.

For photos, I’d be more inclined to agree with you though.

There’s no difference between photos and other graphics, unless you are talking about the stair-stepping that happens during a conversion from line art to bitmaps.

It all depends on the conversion procedure. A format with many steps (such as 8-bit grayscale) works differently than a format with few (2-bit line art). This is not a function of the DPI, but how the conversion is performed.[sup]*[/sup]

If there are many shades of color available, as data is converted from one resolution to another, the conversion will appear smooth. If not, it won’t. This is not a function of the DPI.

To simplify it further, if your program is trying to figure out what shade a dot should be, and it mathematically works out to be a color of 1.29384, what can it do if the only colors available are either 1 or 2? It chooses one or the other, makes the same decision at the next dot, and jaggies result. Color maps and limitations like this are the problem, not DPI.

If you don’t think 2048 pixels wide are good enough to print, consider that 2048 pixels wide for a one-inch image is far greater and sharper than the finest art magazines today (=2048DPI). However, 2048 pixels wide printed on a 20 inch poster would be 100DPI, only as good as newspapers of old.


  • For this reason, if you start with line art (2-bits) and want to reduce or enlarge it, but must end up with line art, convert to 8 bit grayscale first, resize, then convert back to 2 bits. You’ll be glad you did.

Are you familiar with the R statistical programming language? It has a large number of phylogenetics packages (overview here), and several include plotting commands. I haven’t used any of those packages myself, but R is popular with some of the phylogenetics people I know. R has a lot of power to create and customize publication-quality figures, using any format you can imagine (including vector graphics formats). But it has a steep learning curve, so I wouldn’t learning it for this purpose unless you want to spend a lot of time just learning the language. I started learning it a few years ago; it took me a few weeks to figure out how to do anything at all, several months to produce passable figures, and after several years I can produce nice figures with not-too-ugly code.

R is definitely not the way to go if the analysis is done and you just want to make a one-off pretty figure.

ETA: Here are some examples of trees produced by the APE package, including some code snippets.

Windows 7 has a native snipping function that will grab a part of your screen for you.

it’s called “snipping tool”

Just hit your windows key and type “snipping tool”

R also has support for converting its figures into tikz and compiling the output if you have LaTeX installed. You could automate a lot that way…