How to save an image without antialiasing in cycles?

I think this question has been raised numerous of times, but I have yet not found an answer that works.

I'm rendering game graphics with cycles and I need them to be saved in RGB, without any alpha information what so ever.

Setup:

I want to save this picture, exactly as it appears here, with no alpha. But it always saves an antialiased version of it against black.

How can I save the image without antialiased result?

• could you add two small images with how the result looks right now and exactly how you want it to look? Oct 11 '13 at 18:10
• Just to be clear, I don't think the antialiasing is stored as alpha values in a single layer PNG, rather just a mix of whatever color and black (in RGB colors). So with the settings you have now, there is no alpha information being saved.
– gandalf3
Oct 11 '13 at 20:23
• @Gandalf3 I need the object to not be antialised against the background, but still within the object itself. So far Peter's solution worked best for me. Oct 11 '13 at 20:59
• @MaxKielland I agree PeterT's solution is better, but my solution should work for doing that.
– gandalf3
Oct 11 '13 at 23:54

I assume you still want AA within the image, just not at the borders, so I'd suggest that you render with a transparent background and remove the border AA in the compositor:

There's obviously ugly aliasing artifacts here but you could fine-tune the "Greater Than" Node or process multiple alpha ranges differently.

• I went for this solution. It was independent of the objects and I see how it works, I can fine tune it. Thanks! Oct 11 '13 at 20:38
• Is there any advantage to using Image > Separate RGBA > Alpha instead of using the Alpha socket of the RenderLayers node? Oct 13 '13 at 1:55
• @WChargin nope, I just threw this together, you obviously don't need the RGB node either, since you can set the color on the empty image slot on the Mix node itself Oct 13 '13 at 2:09
• To make the background transparent, connect "Greather Than" output to "Composite" Alpha socket. Also, "Set Alpha" node is not required. Jul 31 '20 at 18:11

In 2.67 and 2.68a (I haven't checked 2.69+), the amount of AA present in the cycles render is controlled by the size of the Gaussian sample on the film.

The gaussian for the film is the amount of jitter that rays leaving the camera receive. If this is high, the pixel effectively samples a little circle of incoming light in the scene, and you get anti-aliasing. If this is small, then all the rays are almost the same, and you are sampling one single point on the film.

So to reduce or remove anti-aliasing in Cycles, turn down the Gaussian width in the Film section of the Render settings. Turning it to 0 will reset it to its minimum (currently 0.01 on my version, the default is 1.50), and rendering will give essentially a non AA image.

If you just want to avoid an aliased outline, then this isn't the right setting, do it in the compositor as per PeterT's answer.

The Anti-Aliasing option does nothing for the Cycles renderer, it's only for the OpenGL renderer (=viewport render).

If you wanna have a Cycles render with no AA, try this:

1. Sampling panel, set from Path Tracing to Branched Path Tracing

2. Set AA Samples to 1

3. In the Film panel, untick Transparent

4. Save in RGB mode

• Note that GPU does not work with the non-progressive integrator (it does in the RC, but the OP's screen-shot is of an older version)
– gandalf3
Oct 11 '13 at 18:19
• It sort of worked in 2.69 RC1, but it could occasionally crash on Windows (which is really a Windows problem, stupid timeout error whereby OS believes the GPU crashed if it doesn't respond fast enough and resets driver). Oct 11 '13 at 18:24
• Is this for Blender 2.69RC? I on 2.68. Oct 11 '13 at 20:04

Another way to remove anti-aliasing in cycles is with composite nodes and ID Masks:

1. Enable Object Index in Renderlayers > Passes:

2. Set the pass index of all the objects to 1 by

1. A> Select all (to ensure you have all objects selected, you may also need to un-hide hidden objects (AltH) and toggle all layers visible (~))

2. Set Object Data > Relations > Pass Index to 1

3. Right click on the Pass index setting, and select Copy to selected:

3. This will add a new output to the Renderlayer node. By plugging it into an Id Mask node and setting the Index to 1, you can generate a mask of all the objects. This mask will not be antialiased when the Anti-Aliasing option is disabled:

4. Use the resulting aliased mask as a Mix factor to remove anti-aliasing from the render. This will only remove anti-aliasing from the edges next to the sky, leaving the edges over other objects smooth:

Result:

• Just as a side-note, if there's not transparent surfaces this gives almost the same results as filtering for alpha>0.5 meaning that it will still contain some pixels mixed with the background color if cycles is set to use AA, but they're fairly unnoticeable compared to what the default output gives you. Oct 11 '13 at 18:48
• @PeterT Your solution is better, +1 :)
– gandalf3
Oct 11 '13 at 18:54
• objectively it can go both ways, with your method you don't get these artifacts on straight lines. But using "Greater Than" values of 0.85 seems to be a good compromise. Oct 11 '13 at 19:07
• I did tried this one too, but at a first glance Peter's solution seemed to give me more control and I don't have to fiddle with the index for each object. Thank you any way.. Oct 11 '13 at 20:40
• @MaxKielland PeterT's answer is the better one, but I have updated this answer anyway. (you shouldn't have to fiddle with the the pass index for individual objects, so I tried to clarify)
– gandalf3
Oct 12 '13 at 0:21