text:
Unlimited Wordpress themes, plugins, graphics & courses! Unlimited asset downloads! From $16.50/m Advertisement # Adobe Alternatives: Digital Painting Applications Difficulty:BeginnerLength:LongLanguages: This post is part of a series called The Complete Guide to Adobe Alternatives. Adobe Alternatives: Photo Editing Applications Adobe Alternatives: Vector Applications Welcome to the second installment in our series exploring the world of creative software that lies beyond the realm of Adobe. In the last entry we went over tools available for those who use Photoshop as a photo manipulation program. In this article we’re moving into another specialized area of Photoshop use, and that is digital painting. This article will stick with applications that check off a few boxes. Firstly, they all follow our series theme of being low or no cost–every piece of software in this list is either free or less than$100. Secondly, they all provide the option to secure a permanent license. And thirdly, they all have digital painting as their number one priority. There are several applications that can be used for digital painting as a secondary function, like Affinity Photo for example, but we won’t be touching on those here.

As I mentioned in our series intro, I have personally tried every application in this series in order to fill you in on included features as best I can. I’m sure there are other applications out there I haven’t yet encountered though, so if you use a great digital painting program not mentioned here, please do go ahead and let us know in the comments so others can check it out too.

## 1. Krita

Krita is an incredibly feature rich, dedicated digital painting application that also happens to be fully free, open source and cross platform. It’s developed as part of the incredible KDE project (who also make an entire operating system, by the way).

Krita has actually been in development for a very long time, originally as a general graphic design program, but once it started tightening its focus on painting it began to attract more and more artists and is now one of the most popular applications of its kind.

The real strength of Krita, as well as a workflow paradigm you’ll likely not be used to, comes from its powerful set of brush engines. The engines are fully accessible to allow you to create virtually any type of brush you could possibly require. Whether you want to sketch in pencil or charcoal, emulate traditional media or auto-paint in some special effects and textures, there’s a brush for that.

Krita’s currently available brush engines, through which you can also create your own brushes, are:

• Bristle
• Chalk
• Clone
• Color Smudge
• Curve
• Deform
• Dyna
• Filter
• Grid
• Hatching
• Particle
• Pixel
• Quick Brush
• Shape
• Sketch
• Spray
• Tangent Normal

Where Krita is a little different to other software is that these brushes can also be made to take the place of tools you’d usually grab out of a typical application’s toolbar. Need to do clone stamping? There’s a brush for that. Need to blend, smear or deform? There’s a brush for that. Need to multiply in some shadows, lighten in some highlights, or dodge in some glow? There’s a brush for that too. In Krita there’s a brush for just about everything.

This brush engine also allows you to finely customize absolutely every aspect of the tools you use, as well as to create your own brushes for anything you might need. This level of control allows for a wonderful array of possibilities.

There is one thing I struggled to get used to with Krita’s brushes though: there is no setting for hardness (at least not that I’ve found) and varied brush hardness is something I use heavily in other applications. There is a blur setting, and you can work in other ways to achieve similar ends, but it’s different, and for that reason I found it to be a bit of a jolt to the system.

As a side note, a good tip to be aware of when painting in Krita is to open up the brush settings panel and check the box labelled “Temporarily save tweaks to presets” at the bottom (seen in the screenshot above). This way, when you select a brush preset then choose the brush size, opacity and angle you want, it will be remembered for the duration of the session. Otherwise when you switch to another brush and back you’ll have to set your brush size and so on all over again.

One of the most useful elements of Krita’s workflow is its excellent right-click pop up widget. Hit the rocker on your tablet’s pen and you’ll get an in-place color wheel, a history of your recently used colors, a selection of brushes, and control over your brush’s attributes.

Probably my favorite part of the entire program, as someone who likes to create textures for games, is Krita’s wrap around feature for seamless tiling. By hitting the W key you’ll see your image tiled in both directions, then you can actually paint anywhere you like and your strokes will be recorded to the canvas accurately. So this means no more offsetting a texture by 50% and trying to paint out the seams. You can just freely paint right over the top of the seams as you go, making perfect tiling a breeze to create.

Another thing I look for in a digital painting application is some type of smoothing or stabilizing function. Krita delivers here with the ability to choose between basic smoothing, weighted smoothing and a stabilizer of varying strength. I feel it’s not quite as smooth as the stabilizers in Paint Tool SAI or MyPaint, (more on those later), but I’m sure that’s something that comes down to personal taste. Either way, Krita’s smoothing and stablizing functions are very helpful for people like me who may not have the world’s most stable drawing hand.

I could keep going on about how awesome Krita is, but then I’d never get to the rest of the software we’ll be talking about in this article! So here’s a quick list of some of Krita’s other awesome features:

• Nine drawing assistant types including vanishing point, fisheye, perspective and others (these are great!)
• PSD load and save support
• HDR support
• Mirroring
• Clone layers (edit the source and the clones update in real time)
• Command line exporter (great for batch exports at different sizes and in different formats)

If you’d like to give Krita a run I highly recommend trying out the awesome free brush set created by well known Krita artist David Revoy.

On a side note, Krita is working on further developing its vector tools, so look out, this might be a contender for all kinds of work in the future!

## 2. Rebelle

Rebelle is an incredibly intriguing and fun painting application, and by far its stand out feature is the amazing way it simulates wet media. It also includes dry media, but whether wet or dry the focus across the board is squarely on giving you as close as possible an experience to painting in the real world. You won’t find special effects brushes in Reblle - the categories of available brush all represent physical media:

• Watercolor
• Acrylic
• Pastel
• Pencil
• Ink Pen
• Marker
• Airbrush
• Eraser

What makes Rebelle so special is its ability to physically simulate the behaviour of liquid, or the lack thereof, on your piece. When you paint a stroke with a watercolor brush you actually see the paint soaking into the paper and blending naturally with nearby strokes as it would in real life. There’s even a water tool you can use to lay down a wash and further control how paints soak in, a “blow” tool with which you can blow water across the paper, and a drying sponge to remove water once you’re done

There’s also a “tilt” tool (depicted in the image above) you can use to simulate tipping your paper in different directions, so you can make your wet paints or water run down the page, up the page or in any direction you please. It’s quite fascinating to watch taking effect on your screen, and not a little bit addictive.

If you use a display tablet things get even cooler. If your tablet has an accelerometer in it you can tip it around and Rebelle will respond to it like you’re moving a piece of paper in the real world. And while we’re used to the icon for “smudge” being a finger, in Rebelle that’s taken a step further because on a display tablet with the smudge tool active you can actually push paint around with your finger. It will feel like you’re back in your very earliest art classes doing finger painting.

And the simulation doesn’t stop there. When working with watercolor, acrylic and ink you have the option to set a “water” slider, to decide how dilute you want your paint or ink to be. When you use pastels it will build up layer on layer until you get a thick coating, just like with real pastels. And you can then smear around the excess pastel pigment, again just like the real thing. If you tap your pen on your tablet it will give you the same effect as that motion would with a brush and the bristles will be clearly visible in the mark left on the canvas, while moving in a stroke looks like a real brush stroke.

There’s also blending, smudging, transforming and selecting tools, as well as some handy stencils you can use to paint specific shapes.

If you are a lover of traditional wet media, you might be hard pressed to find another application that emulates them more realistically. And wow, is this thing fun to play with. I would say no matter what your painting style, you should at least experience the glee of taking Rebelle’s free trial out for a run.

## 3. ArtRage

ArtRage and Rebelle are comparable in that the focus of both is emulation of real world media. Like Rebelle, ArtRage provides a relatively short list of brushes, each one correlating with a physical counterpart:

• Oil brush
• Watercolor
• Palette knife
• Airbrush
• Ink Pen
• Pencil
• Paint Roller
• Felt Pen
• Gloop Pen
• Glitter Tube (yup!)
• Paint Tube
• Pastel

Artrage also uses a type of simulation in its painting style, however where the great strength of Rebelle is the simulation of liquid, I would say a great strength of Artrage is the simulation of three dimensional depth. This is particularly striking in the way its oil painting works, which is an absolute delight.

Artrage adds light and shadow to your piece, so you get the impression of layers of paint building up on the canvas. When you lay out oil painting brush strokes you can actually see the highs and lows left by the bristles of the brush. Those little peaks and valleys that are something of a hallmark of oil painting can be faithfully recreated here

You can even put great big globs of paint on your canvas with the Paint Tube tool then smear them all around with the Palette Knife tool. You can see this blending of “globs” used as the basis for a painting in the YouTube video above, and pictured in the top half of the screenshot below.

Top left: Globs of oil paint laid down with the Paint Tube tool. Top center: Two paint globs blended with the Palette Knife tool. Bottom right: Colors painted in with the Oil Brush. Note the light and shadow simulating brush strokes and the color variation where paints of different color have mixed together in a natural way.

ArtRage’s interface is very simple, yet everything you need is easily within reach in handy corner widgets. This is not trying to be a complicated application with panels chock full of tools. It’s aiming to give you the digital version of the kind of tools you’d pick up at an art supply store, and it does this very well.

However even though the interface is kept compact, behind the scenes is the ability to create custom brushes, with a great deal of options to work with. So you can start simply with the tools you see the first time you open up the program, but then you can get into as much depth as you like tweaking and customizing your tools as you go along.

If you are a fan of oil paints, or you love to see texture in art, ArtRage is a must try.

## 4. Paint Tool SAI

Paint Tool SAI is a very straight forward application with a simple interface that’s easy for artists with any experience level to pick up. But while it’s simple it’s also very good at what it does, which is support a drawing style with a leaning towards cartoons, comics and manga.

When you visit the Paint Tool Sai website you’ll see something that looks like it’s straight out of the nineties, and from that first impression it can be easy to suspect the application itself isn’t worth your while. But as much as web designer in me squirms, this is one case where judging the book by its cover would certainly lead to missing out!

Paint Tool SAI is a widely beloved art application, and for good reason. There’s something about drawing in this software that just feels right. When I first tried it I said, “I think this just made me ten percent better at drawing!” It has a very smooth feeling that makes sketching seem like a very natural process.

I was first compelled to try Paint Tool SAI after researching software for doing line art. Over and over, everywhere I looked, it seemed people had the same answer for their favorite application for line art, and that was Paint Tool SAI. After using the application I could see why: it has one of the best stabilizer functions available, and a fluent and intuitive vector drawing system.

When it comes to stablizers, several digital painting applications have them but each one feels a little different. The best one for you will likely come down to personal preference because everyone’s hand and drawing style is different. However for me, Paint Tool SAI’s stabilizer is my second favorite, and it’s at the top of the list for many artists.

The stabilizer helps to smooth out your raster drawing, but for an additional type of fine tuned control there is also SAI’s vector system. These aren’t really vectors like you would be used to in a typical vector drawing program like Illustrator or Affinity Designer. Rather, they are more geared towards making line art and sketching an easier process. When you use SAI’s vector tools they look very much like regular sketching lines, meaning you can draw naturally but with the ability to precisely adjust everything as required.

When you’re done drawing out lines with the vector tools you can easily go in and edit the position and curvature around points, and use a simple click and drag tool to adjust the “pressure” at each point, thereby making the line thicker or thinner there and achieving finely controlled tapering effects.

There are also several painting tools for coloring your work, including an airbrush, generic brush, watercolor brush, acrylic on canvas, acrylic on paper, and crayon.

There are some tricky points to working with SAI though. For example, there are no circle drawing tools in SAI so you have to find hackish ways to create circles, like pasting in images of circles and modifying them, or keeping your pen in one place while you rotate the canvas around it, or combining multiple curves together.

However, if you don’t mind the occasional work around, and you’re into sketching, line art, comics or Manga, Paint Tool SAI should definitely be on your list of prospects.

## 5. Clip Studio Paint Pro (Formerly Manga Studio)

You could arguably think of Clip Studio Paint as Paint Tool SAI’s big brother. It’s a very similar application, with a leaning towards Manga and comic art, and it has just about every tool SAI has. However it also has a series of extra tools as well.

Clip Studio Paint changed its name from Manga Studio as a way to communicate its suitability for more than Manga alone. However if you do happen to be involved in Manga or comic production there are a lot of great tools here to help you along. For example, there is a tool to create comic frames in your document that act like individual canvases. There are also specialized tools for drawing speech and thought bubbles.

On top of that it also has a large collection of ready made, drag and drop comic page layouts and speech bubbles, motion and explosion lines, colored and monochromatic background patterns, clip art style image props, and full 3D models and scenes that can be positioned, scaled and rotated in your document.

An outstanding feature of Clip Studio Paint is the ability to bring in 3D body pose references to help with your sketching. There are pre-existing poses, but any body reference you add can subsequently be posed into whatever stance you need to draw.

Like SAI, Clip Studio Paint has vector tools that are focused on drawing and line art. It also gives you the ability to adjust line weight at each point–I would say here SAI’s adjustment tool is easier to use, but Clip Studio’s gives you more settings to control the effect. Clip Studio Paint also has stabilizer functionality, though for my tastes SAI’s feels a little smoother. But where SAI leaves you to find workarounds to draw circles, Clip Studio Paint does have circle (and square) drawing tools.

Clip Studio Paint also has a larger number of painting tools out of the box than SAI, with a wider variety of painting styles available without the need for custom brush creation. Additionally, creating custom brushes is very easy in Clip Studio Paint. You just create some type of raster drawing on a transparent background, then go to Edit > Register as Material and specify some defaults. This is a very useful function you can use to create all kinds of interesting effects.

If you are creating comics or Manga, Clip Studio Paint is probably at the top of the heap, despite its name change. And if you want easy access to 3D body models as reference, this might be the drawing application for you.

## 6. MyPaint

MyPaint, in my opinion, is a seriously underrated painting application. To be honest I hadn’t even heard of it until I started looking into Linux compatible applications, but once I started using it, I loved it.

For my hand, MyPaint’s smoothing function is the best of all the applications I’ve tried. I love SAI’s stabilizer, but I never feel more comfortable sketching than I do in this software. Another factor that makes it perfect for sketching, i.e. the earliest part of your art workflow, is its infinite canvas. You can start anywhere and are free to improvise in any direction you please.

MyPaint also has a massive array of brush types from traditional media emulators to special effects brushes. It has pencil, charcoal, dry brush, knife, ink, calligraphy, wet knife, glow, leaves, fur, pixel, blur, blend, pastel, sponge smudging, acrylic, oil, watercolor, and several more.

The interface is designed to be very drawing tablet friendly. Everything is laid out so as to be an easy pen tap away, meaning keyboard shortcuts are not necessary. So if you don’t use a display tablet but you feel like sitting back on the couch with a laptop, holding your tablet like a drawing pad, you can do so without the awkwardness of trying to reach for keys to pan, zoom, undo, color pick and so on.

I find MyPaint to be the perfect place to dump all my ideas. I jot down notes, sketch out thumbnails, draw up diagrams and map out concepts. And there’s something about MyPaint that might sound a little wishy washy, but when I use it I feel more relaxed than with any other software. It gets out of your way and just lets you run with whatever is in your mind.

Even if MyPaint doesn’t become an application you use for end-to-end workflows, there’s a pretty good chance you’re going to find it useful in one way or another. And with it being free, open source and cross platform there’s nothing to stop anyone from slotting it into their workflow wherever it proves helpful.

## Which Digital Painting Software to Choose?

There is definitely some cross over in the features of every single application we’ve covered in this list. But though they can all be used to create wonderful drawings and paintings, they seem to group themselves into pairs in the way they are strongest. Rebelle and ArtRage for emulating physical media. Paint Tool SAI and Clip Studio Paint for Manga and comics. Krita and MyPaint as digital painting "multi tools", both free and open source.

If you’re choosing between Rebelle and ArtRage, there are many points on which both have pretty much equal footing. So to my mind the real separator is watercolor vs oils. If you love watercolors go with Rebelle, and if you love oils go with ArtRage.

If you’re choosing between Paint Tool SAI and Clip Studio Paint, for effectively the same price Clip Studio Paint has pretty much everything SAI does plus a number of extra features. However the drawing feel of Paint Tool SAI keeps a lot of people swearing by it. In my opinion the only real way to choose is to put the feature set aside for a moment, download trials for both and see how you take to drawing and using vectors in each. You may love SAI’s feel enough that it outweighs the relatively limited tools, or you might prefer the simplicity of that smaller tool set. But if you enjoy the drawing feel in Clip Studio Paint just as much you might go for the extra features instead.

And finally Krita and MyPaint. They’re both completely free so there’s really no need to choose between them. Rather, I feel they work well together at different points in your workflow. I like to use MyPaint and the conceptual and planning stage, then move on to Krita for the full production. But I’ve seen other artists who like to reverse that, starting their pieces in Krita then moving to MyPaint for finishing. Have a play around with them and you’ll soon figure out where they fit into your style.

## Up Next: Vector Art

We’ve covered two of the specialty areas Photoshop is often used for: photo editing and digital painting. We still have one more group of specialists to touch on that is perhaps less populous, but equally awesome: pixel art.

However, before we get to that, we’re going to talk about applications for what is probably a larger group of artists at present, and that is vector artists. We mentioned a small amount of vector functionality in some of the applications in this article, but for serious vector work you’re going to need something a little extra.

You might be surprised just how many fantastic alternatives there are out there for vector art, each with their own unique perks and features. I’ll tell you all about them in the next article.

I’ll see you there!


text:
# Finding the x and y components of a vector that is projected tangent to a circle

Here is a diagram I made for the problem.

There is a very similar question on this website, but there wasn't a clear solution for that one when it came to the components of the vector. They seemed to just find the magnitude of that vector as seen here: Finding the component of a vector tangent to a circle

The problem is how do I find the actual x and y components of this tangent vector because all of the solutions I've seen don't find signed components which I need for the simulation I am programming. I took vector calculus and linear algebra about 3 years ago, so I just can't seem to figure out this problem.

• I'm confused about the purpose of the green circle's velocity arrow, since in a circular motion the velocity of the object should always be tangent to the circle. Mar 29 '17 at 5:54
• Construct a right triangle, with radius as hypotenuse. Find trignometric ratios and using them you can get the answer. Mar 29 '17 at 6:13
• What right triangle do you have in mind, exactly?
– amd
Mar 29 '17 at 9:36
• @YiyuanLee Its for a game where the green circle is moving around the screen freely in any direction then when a key is pressed the green circle swings around the other circle as seen in this gfycat gfycat.com/DamagedEmbellishedDoctorfish Mar 30 '17 at 15:54

1) Construct a unit vector $\vec n$ perpendicular to $BG$ ($B$ and $G$ are the centers of blue and green circles):

$$\vec n={(-y_G+y_B,x_G-x_B)\over\sqrt{(x_G-x_B)^2+(y_B-y_G)^2}}.$$

2) If $\vec v$ is the velocity vector (green) then the vector you want (orange) is:

$$(\vec n\cdot\vec v)\vec v.$$

• Thanks for the answer, but isn't $$(\vec n\cdot\vec v)\vec v.$$ a magnitude? I need the x and y components of the orange vector Mar 29 '17 at 8:02
• @BradMatias No. The left factor is a scalar, the right one a vector.
– amd
Mar 29 '17 at 9:34

It looks like you’re looking for the projection of the green vector onto the tangent to the large circle. This is the same as finding the orthogonal rejection from the normal to the circle at that point, which is the difference between the vector and its projection onto the normal.

Let $\vec n=\langle x_g-x_b,y_g-y_b\rangle$ and $\vec v$ be the velocity vector. $\vec n$ is parallel to the radius of the large circle at the green circle’s location, so is clearly normal to it there. The tangential velocity is then $$\vec v_{\text{tan}}=\vec v-{\vec v\cdot\vec n\over\vec n\cdot\vec n}\vec n.$$ Taking the values in the illustration, this gives $$\vec n=\langle128,196\rangle-\langle64,64\rangle=\langle64,132\rangle \\ \vec v=\langle10,3\rangle \\ \vec v_{\text{tan}} = \langle10,3\rangle-{\langle10,3\rangle\cdot\langle64,132\rangle\over\langle64,132\rangle\cdot\langle64,132\rangle}\langle64,132\rangle=\langle10,3\rangle-{1036\over21520}\langle64,132\rangle\approx\langle6.92,-3.35\rangle.$$

• this solution works for counter clockwise tangents, but when this process is applied to a starting velocity where it would result in a clockwise spin it still returns a vector pointing in the clockwise direction. Here's a gfycat of it happening gfycat.com/BrokenDearestGrayling Mar 31 '17 at 6:12
• @BradMatias If you’ll look again at the example that I worked with your own data, you’ll see that it is a clockwise tangent. Using the same two points and $\vec v=\langle 0,10\rangle$ instead, I get a tangential velocity of approx. $\langle-3.93,1.90\rangle$, which is a counterclockwise tangent. If it’s not working for you, then you’ve probably got a sign error or some other arithmetic error in your computation.
– amd
Mar 31 '17 at 6:32
• oh I literally have no idea how my edit didn't go through, your solution is right I edited my comment, but I guess it didn't send. The issue I had was when I was calculating angular velocity from the output of your solution I wasn't getting a signed answer. Apr 1 '17 at 9:38

format: plain


text:
Question:

Expression {mx - 1 + 1/x} is non-negative for all positive real x.Minimum value of m?
a)0
b)(-1/2)
c)(1/2)
d)(1/4)

Solution

Since we want the value of the function to be non negative.

You need to model this into some theorem which relates inequality with the value of function.

Some of us said we can convert this to a quadratic and then look at when does the value of quadratic be non-negative.

Secondly some looked at the AM, GM concept to solve it.

Approach 1:

By applying the dscriminant property of the equation {mx^2 - x + 1}
For the expression to be non-negative , D should be ≤ 0
That is,
(1-4m) ≤ 0 m ≤ (1/4)

Approach 2:

By applying A.M.,G.M. concept;
Let mx and 1/x be two no.s such that
(mx+1/x)/2 ≥ Sqrt(m)

That is,
(mx + 1/x -2sqrt(m)) ≥ 0 Comapring it with the original equation , we get
2sqrt(m) = 1

m = (1/4)


text:
# How can I create a pdf document exactly as big as my tikz picture?

I often create pictures in tikz that I want to either send to someone, or include in an email. The problem with that is that there is a big white space around and and especially below my pictures.

To get around this, I usually print screen my figure and crop it to get the size I want. Another solution is to use beamer and then scaling to make the figure as big as the slide size. Those two solutions, though, are not all that good. What I would really like is a way to get the pdf file to be just as big as my picture, as if it was cropped from start.

Is there a package to do that?

-

TikZ can do that itself. Have a look at section 63 of the TikZ documentation: “Externalizing graphics.”

This describes how all TikZ graphics in a given document can be pre-processed to speed the actual processing of a document. This results in one PDF file per TikZ graphic.

This is the (shortened) example document:

% This is the file survey.tex
\documentclass{article}
\usepackage{graphics}
\usepackage{tikz}
\pgfrealjobname{survey}
\begin{document}

In the following figure, we see a circle:
\beginpgfgraphicnamed{survey-f1}
\begin{tikzpicture}
\fill (0,0) circle (10pt);
\end{tikzpicture}
\endpgfgraphicnamed

\end{document}

The following command produces the image file survey-f1.pdf from the above document, cropped to just the TikZ picture:

pdflatex --jobname=survey-f1 survey.tex

-
@Konrad: but where do I put this command?? –  Vivi Jul 28 '10 at 19:39
@Vivi: just on the command line when you compile your tex file. Just run "pdflatex survey.tex" add the option Konrad supplied. –  Suppressingfire Jul 28 '10 at 19:58
@Suppressingfire: what command line? I don't use a command line, I just use an editor. I just point and click in the editor to "compile" and it does it for me (I actually use Emacs and type C-c C-c, but that doesn't change my question). Where can I go to run this command? –  Vivi Jul 28 '10 at 20:30
@Vivi: I guess that the easiest way when working with a tool chain like LaTeX is to use a command line. But you can also put this command into a shell script in your project’s folder, and execute that script. On Windows, a shell script is just a text file that ends on .cmd. You can execute it by double-clicking on it. For Linux, its usual ending is .sh and the process is similar, but it needs a shebang line and the beginning. Beware that on Windows, the system may have difficulties finding the latex executable if it’s not properly set up. –  Konrad Rudolph Jul 30 '10 at 14:55
@Konrad: I use mac OSX hehe :) –  Vivi Jul 30 '10 at 22:43

The package standalone does just that. It is a new package (released this year, I think) which will produce a document exactly as big as your figure (and you can use this for text or other things as well). Here is how you would set up your document

\documentclass{standalone}
\usepackage{tikz}
%include other needed packages here
\begin{document}

\begin{tikzpicture}
% include your tikz code here
\end{tikzpicture}

\end{document}

If you do that, then you will be able to compile this directly to get a .pdf document exactly as big as the figure, which can then be included in emails, word documents, or even as a picture in another .tex document using the \includegraphics{} command.

The best thing about this is that it can also be included in a .tex document (e.g. article, beamer, etc.) as a .tex file using the \input{} command without having to change anything in the .tex document above. The main thing is to include the package standalone in your preamble (i.e. before \begin{document}) together with any packages you used in the above code, which in my example would be:

\usepackage{standalone}
\usepackage{tikz}

and then where you want the picture to go put, for example:

\begin{figure}[!h]
\input{mytikzfig.tex}
\caption{  }
\end{figure}

where mytikzfig.tex is the .tex document with your tikz picture using the standalone package.

You can see this solution given in an answer to an StackOverflow question.

-
Hadn't seen this package before, thanks. –  Will Robertson Jul 29 '10 at 2:40

For a single TikZ picture, you can also use the preview package

\documentclass{article}

\usepackage{tikz}
\usepackage[active,pdftex,tightpage]{preview}
\PreviewEnvironment[{[]}]{tikzpicture}

\begin{document}

\begin{tikzpicture}[options]
...
\end{tikzpicture}

\end{document}

-
This is the method I use. I adapted it from CirKuit. (see on SO) –  David Z Jul 28 '10 at 19:31
It is also the method used by texample.net to prepare PDF output of submitted examples. –  Sharpie Aug 4 '10 at 4:24

Make sure that there's nothing extra on the page (page numbers, for example, using \thispagestyle{empty}) and then use the command pdfcrop which is included in TeXLive. (It's a perl script).

That's what I used to make this picture for this answer on MathOverflow:

-
@Andrew Stacey: I don't understand what you mean by "use the command pdfcrop". How would you do that? I don't see it in your .tex file. Would you be able to explain? –  Vivi Jul 28 '10 at 19:35
It's a shell command, i.e. a separate program you have to run after you generate the full PDF file, that will crop off all the white space around the edges. –  David Z Jul 28 '10 at 19:43
Sorry, can you be more specific? How can I run a shell command? I keep seeing that, but I have no idea of how to do it... Do I need to type something in the terminal? If yes, what can I type? Is there a software I need to get to "run the shell command"? –  Vivi Jul 28 '10 at 20:29
@daroczig: I just ran pdfcrop on all the PDFs in the directory where I try out hacks for this site. On a total of 67 PDFs (most single paged, but that's what this answer is targeted to) it took 1 minute to process them all. Given that there is no loss of information in this cropping, I would not expect a decrease in file size. Then the fact that the median increase in file size was 110% says that this is fairly efficient. So I'd like to see some evidence of your claim before I take any notice of it. –  Loop Space Feb 14 '11 at 10:33
@daroczig: Thanks for adding the information. It is possible that we are talking about different programs. When I search for a homepage for pdfcrop then I get pdfcrop.sourceforge.net which is not the program that I was talking about. I'm talking about the program pdfcrop by Heiko Oberdiek which comes with TeXLive. I don't understand the characterisation of this solution as "tricky"; if someone is a commandline junkie (like me) then it could be a lot simpler than an inbuilt solution. But then I'm not offering this as THE solution, just a solution. –  Loop Space Feb 14 '11 at 13:22

Since Konrad's answer didn't work for me and my version of pgf I took a look at the manual and came up with the following solution from the manual:

\documentclass{article}
%  main document, called main.tex
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=figures/] %  activate

\begin{document}
\tikzsetnextfilename{trees}
\begin{tikzpicture} %  will be written to ’figures/trees.pdf’
\node {root}
child {node {left}}
child {node {right}};
\end{tikzpicture}

\begin{tikzpicture} %  will be written to ’figures/main-figure0.pdf’
\draw[help lines] (0,0) grid (5,5);
\end{tikzpicture}
\end{document}

The following command will generate the figures:

pdflatex -shell-escape main

-